Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

Restrict tag picker field for leaf tags only (tags that doesn't have children)

Avatar

Level 1

Hello,

 

We would like to restrict the tag picker field, so when our editors edit the properties of a page, they could only select tags, that does not have any child tag.

For example, there is the "Fruit" tag and under that, you can have "Berries" and under that you can have different kinds of berries like blueberry, cranberry, raspberry etc.

Currently we are able to select the "Fruit" and "Berries" tags, but we would like to disallow this behaviour, and only allow selecting the specific berries.

 

Is this possible? If so, how?

Thank you,

Marci

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 1

I ended up adding a custom js to the clientlib, that hides all checkboxes, of variant = "drilldown" on the

foundation-selections-change event
Thanks again

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @Jozsef_MartonVa ,

 

You can try to implement custom jQuery  logic to achieve this. The logic will perform below stesp:

1.  Validation on tags selection.

2. Server call or ajax call to check if selected tag is a child node.

3. Return boolean based on that.

4. Trigger the validation message if its is child tag.

 

Hope it helps!

 

-Tarun

Avatar

Level 1

Hello @TarunKumar 

Thanks for the help.

Can we disable the checkbox on these tags? It would be more desirable from UX point of view.

Avatar

Correct answer by
Level 1

I ended up adding a custom js to the clientlib, that hides all checkboxes, of variant = "drilldown" on the

foundation-selections-change event
Thanks again

Avatar

Level 5

Changing the tags picker functionality is not possible. You can either validate and remove the tags or modify the tags selection on submission of dialog using listeners