Skip to content
English
  • There are no suggestions because the search field is empty.

Custom Feature Configuration: Hub Association

In this article, learn how to setup a custom feature to associate certain SharePoint sites with the right hub.

    Getting Started

     

    This intended to showcase examples of Orchestry's Custom Feature option. From a product support standpoint, we do not assist in creating or debugging custom features.

     

    Before creating a custom Feature, definitely check out our more introductory articles on:

    Feature Proposal

    Have you wondered if you can ensure each workspace from a given template gets attached to a pre-existing SharePoint Hub (e.g., every Project attached to a Project's Hub"). You can do that systematically using a PnP feature, or can do so more granularly using Power Automate (not in scope of this article).

    Creating a Custom Feature

    Because Features leverage and utilize the PnP Framework, there are a huge number of possible use cases for features from custom Lists and Libraries, to SharePoint Page layouts, to applying search settings to sites, and much more.


    For this article, we will use the example of creating a feature to associate a SharePoint site to an existing Hub.

    Step 1: Configure a Site with the Desired Feature(s) to Extract

    • Associate a site in your environment to the desired Hub

    Step 2: Extract the Template

    • Access Orchestry Management > Tools > Template Files
    • Click "Extract New Template"
      2024-05-10-10
    • Name the template (e.g., Extracted_HubAssociationNexus)
    • Browse for your SharePoint site where this is already in place
    • Under Advanced Configuration
      • Under extraction handlers, select only WebSettings

        2024-05-10-12

      • De-select everything else

        2024-05-10-12

      • Click Extract PnP File (progress will be displayed while processing)

        2024-05-10-13

      • When complete (if successful), the newly extracted template should appear in the list of Template Files with the name you specified

        2024-05-10-14

    Step 3: Clean Up the Template

    Unfortunately, the extraction we performed was as granular as PnP permits, yet it still contains unnecessary and potentially unwanted information in the Template File.


    • On the new template file, click the download button

      2024-05-10-15

    • From your local machine, locate the newly downloaded file and rename its extension to .zip rather than .pnp

      2024-05-10-16

    • Extract the Zip Archive

    • Navigate to the new folder with the information, open the Files folder and open the .xml file in a text editor like NotePad++

      2024-05-10-17
    • In the Editor, locate the WebSettings section which is the type of handler we chose to extract. Remove everything other than the desired parameter, which in our case is 'HubSiteUrl'. Ensure to properly close the section and Save the file.

      2024-05-10-18

    • In your folder, if a .bak file has appeared, delete it.

    • Select all the files in the folder, and Compress to Zip, and while doing this, rename the file extension to .pnp.

      2024-05-10-19

    Warning: Do not change the name of the PnP File as part of this process, otherwise the feature will not work

    • Return to Orchestry, deleting the original PnP file

      2024-05-10-20

    • Upload the new PnP file to Orchestry (with the same name previously used)

      2024-05-10-09

    Usage

    Triggering Features to Apply to Existing Workspaces

    Another great feature of Orchestry is the ability to manually apply templates to existing workspaces, which can be very valuable if you want to apply features retroactively. Keep in mind this process is currently not a "bulk" operation, but something that can be done on a workspace-by-workspace basis. 

    Applying a Feature to Existing Workspaces

    Attaching Features to a Template

    To attach a new feature to a workspace template, check out the article: How to Configure Features in Workspace Templates