Atlas "User Preferences" can be set by each user by going to the My Atlas menu and clicking My Preferences. You can learn more here: My Preferences (Atlas 4.0+)
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).
Configure the In Focus web part to be affected by User Preferences
Toggle using the UI
First, make sure you're editing the page, then edit the In Focus web part you want to configure. Preferences matching can be configured for any In Focus web part simply by editing the web part configuration, then toggling the Apply user preferences setting in the Search tab of the In Focus web part configuration panel to "On":
The toggle will include all preference fields using OR logic, and values within each field using OR logic. In other words, no matter how many tags you choose for each preference field, only 1 of the tags across ALL fields needs to match the content.
Manually configure specific preferences matching
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 can add the additional filters to the query to apply the Preferences Matching. In the next section we give some examples of how you might use this.
Please note that the query could also come from the Verticals in which case you would add it to the Verticals not to the Query template since the template is overridden by Verticals.
Apply all matching using AND logic
Clear the text from the Query template box (or the Query in a Vertical configuration) then paste in the following instead:
{searchTerms} CPOverrideUserPrefOWSBOOL:1 OR ({|CPLocationGeographyTaxId:{User.CPGeography}}) AND ({|CPDepartmentsTaxId:{User.CPDepartment}}) AND ({|CPSubjectTaxId:{User.CPSubject}}) AND ({|CPActivityTaxId:{User.CPActivity}}) AND ({|CPEntityTaxId:{User.CPEntity}}) |
This will apply matching across all preferences for the current user but instead of the default OR logic instead we have constructed the query using AND logic, so ALL FIVE tags added by the user will be have to match the content.
The above query also allows 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 set 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}})
Additionally, we again apply the override logic (CPOverrideUserPrefOWSBOOL:1) so that the override toggle against content will work as expected.
So for example, the following query will match against preferences for Department and Subject, where any tag between both those columns can match the content:
{searchTerms} CPOverrideUserPrefOWSBOOL:1 OR ({|CPDepartmentsTaxId:{User.CPDepartment}}) OR ({|CPSubjectTaxId:{User.CPSubject}}) |
Alternatively, we change to AND logic between the 2 fields, so now this will match against preferences for Department and Subject, where AT LEAST ONE tag from each field must match the content (unless the override is set):
{searchTerms} CPOverrideUserPrefOWSBOOL:1 OR ({|CPDepartmentsTaxId:{User.CPDepartment}}) AND ({|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.