How to: display content dynamically (context paths)
Would you like to display content in the widget dynamically based on a page your user is currently on? By setting context paths, you can indicate the path/page in which a topic should appear. Topics for which you set up context paths will be highlighted and pushed to the top of the list within the widget when the user lands on that particular page.
In this article, we’ll show you how to set it up.
To set up context paths:
- While in the Authoring tool, open the desired topic to edit.
- Click Manage under the topic title.
- In Context paths field provide relevant paths. If you want to enter multiple paths, separate them by a new line (path per line). Don’t include the domain name.
If you want to, you can use wildcards, for example, sites/* - it will apply to all paths that start with sites/ including sites. It will match sites/create and sites/321/topics.
- Confirm with Save button.
If your homepage is like http://example.com/home and it is being routed to http://example.com, it will not match if you only add home to the context paths, you need to add another line and /.
Setting up context paths will result in highlighting topics and pushing them to the top of the list when a user lands on that particular path. All topics will be visible within the widget. If you want to display only relevant topics based on a context path and hide the rest, refer to this article.
URLs are case sensitive in this field.
At the moment, it's not possible to exclude specific topics from individual pages.
By default, all content you create appears in the widget and is listed in the order it’s created, unless you manually rearrange the topic list. With context paths, you can display content dynamically based on where a user is in your application.
For example, you may have an important article that you want to prioritize in your widget when a user is on a page http://example.com/sites/create. In that case, you can add sites/create to the context paths settings. Now, when the user visits that page, the article will be highlighted and placed on top of the list.
With context paths, you can provide in-context, in-app guidance and keep users engaged, converting, and learning.