Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Associating a 'Primary' tag to pages?

Avatar

Level 5

On all of my editorial pages, I need to surface a 'primary category' as a form of badge visually on the page.  The categories basically overlap with our tags, so I want to leverage tags to do this.

 

At first, I thought I would just take the first tag associated with the page and treat it as the primary.  Through marketing/editorial process we would always associate tags in order of their importance to the current page... however, it doesn't appear that the Tagging API provides the tags back in any meaningful order (maybe they're just alphabetized? not sure).

 

So now I'm back at the drawing board- I think what I need to do is create a singular field on all pages called `Primary Tag` which would let you pick a single tag to apply to the page.  If I do this though, then I am afraid I am going to make search a lot more complicated under the hood (OOTB query builder).  Are there any pitfalls in doing this, and which field type would be the most appropriate if I followed this approach?

 

AEMaaCS 6.5.*

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

fetch the value in a dropdown using datasource, there you can restrict the primary tag and maintain order as well and you can provide search capability 

Example

https://aemlab.blogspot.com/2018/08/searchfilter-touch-ui-dialog-dropdown.html 



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

fetch the value in a dropdown using datasource, there you can restrict the primary tag and maintain order as well and you can provide search capability 

Example

https://aemlab.blogspot.com/2018/08/searchfilter-touch-ui-dialog-dropdown.html 



Arun Patidar