AEM Tag picker widget on a page

心已入冬 提交于 2019-12-13 03:47:27

问题


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:


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.



来源:https://stackoverflow.com/questions/55345318/aem-tag-picker-widget-on-a-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!