This article will explain how you can set up a dynamic page that can be filtered by passing a Query String through the URL. This relies on configured In Focus web parts which pull the Query String from the URL and apply it as a search filter.
So instead of having 100s of Subject pages you could have a single page, and provide a Query String when linking to that page which passes the filter(s). In this case new Subject tags would not require a new page to be built, just a new link created with the correct Query String filter. This can be applied to both Legacy In Focus web parts and the updated In Focus web parts from version 5.0 onwards.
Note that if you need to provide different static content such as Text or Image web parts for each subject you'll still need to create a page for each one.
In this article:
- Configure In Focus web parts to filter by Query String
- Creating the right Query Strings
- How to link to the page using Query Strings
Configure In Focus web parts to filter by Query String
To get started, you'll need a page with one or more In Focus web parts added. You can design the page before or after setting up the Query String filtering but that will not be covered in this article - for now we just need the In Focus web parts added to the page.
- Go to your page, then in the URL bar add a Query String, for example "?q=test", then load the page again with the modified URL. This is required so that In Focus can see a query string to continue the configuration. Please note you can replace q with something more relevant if you wish.
- So if your page is at...
https://TENANT.sharepoint.com/sites/Atlas/SitePages/pagename.aspx
you should modify the URL to... - https://TENANT.sharepoint.com/sites/Atlas/SitePages/pagename.aspx?q=test
- So if your page is at...
- Edit the page. Your query string should still be visible in the URL.
- Edit your In Focus web part(s). If you have multiple web parts return to this step after each one.
- In Atlas versions prior to 5.0 (or if using the Legacy In Focus), open the Search section of the config panel and change the Search Query to "Dynamic value":
- In Atlas 5.0 and later, open the Conections section of the config panel and turn on Connect to search box or other input query then choose "Dynamic value":
- The next steps are shared between both In Focus versions.
- In Atlas versions prior to 5.0 (or if using the Legacy In Focus), open the Search section of the config panel and change the Search Query to "Dynamic value":
- Below the "Dynamic value" option, a dropdown will appear. Choose "Page environment".
Please note in 5.0 there is sometimes a bug where the text for this option is blank - in this case choose the blank option from the dropdown.
- As you choose each option another dropdown will appear for the next part. Use the below options to set up your web part. Note that I am using simply the letter q as the query string identifier - if you used something different choose that instead.
- You can choose whether or not to "Use a default search query" - if you always plan to provide a Query String in the URL this would not be needed, but if users might visit the page without a query string it could be desirable to set up a default filter.
Creating the right Query Strings
Now that you set up your web parts, you can test the configuration by accessing the page with different Query String values. If you just want to use a keyword filter without matching a specific tag, this could be as simple as ?q=string. This will return all items matching the In Focus query, which also contain the text "string" anywhere - in the content or metadata.
However, Atlas promotes tagging content and filtering works best with tags, so we would usually advise setting up Query Strings to filter by a value in a specific tag. You can do this by specifying the Managed Property and the desired value in the Query String.
- First, look up the Managed Property for the field you want to filter by from this article: Atlas Managed Properties for Search
- So let's say you want to use Department, the property is RefinableString147. Let's filter by the Finance department.
- To filter this using the Query String, add to the page URL ?q=RefinableString147:"Finance" and load the page with the modified URL. You can see that only Finance tagged content is returned.
How to link to the page using Query Strings
So you have your page, your configured web parts and you now know how to set the filter using the Query String. Test each link you plan to add by navigating to it in the browser and verifying the content coming through the In Focus web parts on the page. You can then simply use that link in an Atlas Useful Link or Spotlight, or as static content on a page such as a link in the text, Quick Links, etc.
Since it is just a URL you could also link to it from outside Atlas; in an email or Teams message.
Comments
0 comments
Please sign in to leave a comment.