In a default configuration the Atlas "My Preferences" panel will only apply filtering to the My News component, so if that component is not added to any pages the preferences will not be utilised anywhere. It is possible to apply these preferences as additional filtering in other In Focus web parts, and that is what we will show in this article. Please note that this is considered advanced configuration.
In Atlas 4.0+ this feature can be configured simply by toggling the following setting in the Search tab of the In Focus web part configuration panel to "On":
The toggle will include all preference fields, but you could still use the information in this article to configure matching for only specific preferences; e.g. only matching against the Department.
In this article:
Prepare an In Focus web part
Before you start, you should add an In Focus web part returning the type of content you want added to a page, for example Documents (Atlas) or Events (Atlas).
If you want to return specifically News items, you can use the My News web part directly instead of having to follow the configuration steps below.
Configure the In Focus web part to be affected by User Preferences
First, make sure you're editing the page, then edit the In Focus web part you want to configure. In the second panel of the configuration options, you will see a box labelled Query Template containing the text "{searchTerms}":
This is where we will add the additional filters to the query to apply the Preferences Matching.
Apply all matching
Clear the text from this box then paste in the following instead:
{searchTerms} CPOverrideUserPrefOWSBOOL:1 OR ({|CPLocationGeographyTaxId:{User.CPGeography}}) OR ({|CPDepartmentsTaxId:{User.CPDepartment}}) OR ({|CPSubjectTaxId:{User.CPSubject}}) OR ({|CPActivityTaxId:{User.CPActivity}}) OR ({|CPEntityTaxId:{User.CPEntity}}) |
This will apply matching on both the Department and Location preferences for the current user, and also allow the override toggle to work properly if applied to content - e.g. items with override set to "On" will be shown to all users regardless of their preferences.
Once you have done this, Save or Publish the page to ensure your changes are saved to the web part.
Apply specific matching
As you can see above, the query is simply using an OR statement across the matching for each metadata field. This means you can choose which fields to include.
The following are the parts of the query for each metadata field:
- Location: ({|CPLocationGeographyTaxId:{User.CPGeography}})
- Department: ({|CPDepartmentsTaxId:{User.CPDepartment}})
- Subject: ({|CPSubjectTaxId:{User.CPSubject}})
- Activity: ({|CPActivityTaxId:{User.CPActivity}})
- Entity: ({|CPEntityTaxId:{User.CPEntity}})
So for example, the following query will only match against preferences for Department and Subject:
{searchTerms} CPOverrideUserPrefOWSBOOL:1 OR ({|CPDepartmentsTaxId:{User.CPDepartment}}) OR ({|CPSubjectTaxId:{User.CPSubject}}) |
Once you have done this, Save or Publish the page to ensure your changes are saved to the web part.
Comments
0 comments
Please sign in to leave a comment.