页面上的AEM标签选择器小部件 [英] AEM Tag picker widget on a page

查看:132
本文介绍了页面上的AEM标签选择器小部件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一种功能,用户可以从名称空间中选择标签并单击按钮。

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

当前,我们有一个文本框,用户需要输入标签ID。但是,他们不方便知道tagID。

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

有什么方法可以创建标记小部件(或路径浏览器)在组件HTML上,类似于它在对话框中的工作原理?

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 ?

我知道Coral UI依赖关系可能是一个问题,但只是好奇我们是否可以实现。我从未做过这样的事情。

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

推荐答案

我在这里写过类似的答案

I hadwritten a similar answer here


AEM工具:使用Coral的标签选择器

我覆盖了

cq/gui/components/common/tagspicker

在apps文件夹中,然后进行编辑

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();

AttrBuilder attrs = htmlTag.getAttrs();




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

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

其中tagSpace指 / etc / tags / customTagSpace内的自定义标签位置

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

您可以将其传递到OSGI配置或任何可配置的内部,而在 render.jsp 内部,则可以使用脚本或其他方式进行传递方法,然后显示它。

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.

这篇关于页面上的AEM标签选择器小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆