Why would I use this Add-on in Combination with the Enterprise Theme?
The big use case is user specific news. If you have a big Confluence instance with multiple departments or countries, corporate communication can be challenging. You might want to solve requirements like these:
- How can I make sure that a user is receiving only news relevant to him/her?
- How can I provide a filter for the news - depending from where a user is from?
- How can I get users to only see their department specific news and their country specific news?
All this can be solved, if you combine the Enterprise Theme with the User Profiles Add-on. And you can build even more flexible solutions by combining it with the optional Metadata add-on.
How to use Metadata Information in the Enterprise Theme macros
All Enterprise Theme News macros provide an input field for a Lucene Query parameter. With this parameter you are able to enter every lucene query you like. A detailed documentation about this parameter can be found under the Lucene query parameter of the news macros.
The Communardo User Profiles Add-on extends the search index with every user profile element you create in that add-on.
To use the User Profiles elements in the Enterprise Theme news macros you need to follow these steps:
- Find the name of the element used in the index
- Combine the name and a static prefix to create a placeholder. This placeholder represents the user specific dynamic value.
- Use the name to build a valid Lucene query
- Add this query to the news macro parameter Additional Lucene Query (The Lucene query parameter of the news macros)
Determining the Name of a User Profiles Element
The name of a user Profiles element is the englisch default title you entered during creating the Field. To get this name, you can access the User Profiles configuration via the menu item User Profiles for Confluence > Profile Elements in the panel on the left side of the administration console (choose Cog icon > General configuration at the top right of the screen).
Image 1: Configuration – Profile Element Overview (click to enlarge)
If you click on edit or you create a new field you are able to see or define the default title for this field.
Image 3: Editing Profile Element (click to enlarge)
Create the placeholder for the query
The placeholder for the lucene query parameter of the news macros is created by this syntax:
upc.currentUser.<FieldName>
For example: for the field Location
, your resulting placeholder will be upc.currentUser.Location
.
Whitespaces in your fieldname will be replaced with an underscore (_) .
Please take a look into the following examples:
Examples for Syntax of Lucene Query
If you have found the name of the User Profile Element you could create a placeholder for the user specific dynamic value.
Basic search terms with Lucene search syntax are explained at the beginning of this section. Find more complex examples below.
1) Show the content of all pages where the location of the user is set as a label
// Lucene Query labelText:upc.currentUser.Location
2) If there is a field with all important labels for the specific user, you can filter the news accordingly
// Lucene Query labelText:upc.currentUser.ImportantLabels
Advanced Usage
3) Filter by the User Profile
The Enterprise Theme allows you to combine more in our content macros Metadata add-on by Communardo you can combine the Metadata Information of the content with the profile information of the current user. This allows you to provide a very user specific content listing in the Enterprise Theme Macro.
If you use the// Lucene Query metadatafield.city:upc.currentUser.Location
The field metadatafield.city
is created by the Metadata add-on in the search index. How you can create such queries and how you retrieve this field names can be read in the "Use the Communardo Metadata Add-on with the Enterprise Theme News Macros" documentation and in the macro documentation of the Top Stories Slider, Blog Posts & Pages and News Boxes macros.
Parts of this documentation were copied from the User Profile documentation.