AEM Tag picker widget on a page

1.3k Views Asked by At

I am working on a functionality where the user selects a Tag from a namespace and clicks a button.

Currently, we have a text box where user needs to enter the tag ID. But its not convenient for them to know the tagID.

Is there any way to create a Tags Widget (or a Path Browser) on a component HTML, similar to how it works in the dialog ?

I know Coral UI dependencies may be an issue, but just curious if we can achieve that. I've never done something like this.

1

There are 1 best solutions below

0
Akshay Rathnavas On

I hadwritten a similar answer here

AEM Tools: Tag Picker using Coral

I had overlaid the

cq/gui/components/common/tagspicker

in the apps folder, and then edited the piece of code in the render.jsp to pick the tags from the desired path.

AttrBuilder attrs = htmlTag.getAttrs(); . . . . .

attrs.add("data-basepath", cfg.get("tagsPath", tagSpace));

where tagSpace refers to the custom tag location inside the /etc/tags/customTagSpace

You can pass it inside an OSGI configuration or anything configurable, where inside the render.jsp you can pick up using scriptlets or other methods and then display it.