jquery - 如何在 AEM Touch UI 对话框中查找组件路径?

标签 jquery aem aem-touch-ui

我想要例如在 jQuery 中获取路径 /content/branc/region/microsite_name/en/mypage/jcr:content/par/mycomponent

我可以使用 Granite.author.page 获取页面路径。

获取页面路径的代码:

(function ($, $document, author) {
    "use strict";   
$(document).on("dialog-ready", function() {
    var path = author.page`enter code here`.path; //This works
    var component = author.component.path; //This is not working
    console.log("component path " +component);
   });
})($, $(document), Granite.author);

请教一下如何在jquery中获取组件路径。

最佳答案

资源类型可在 Granite.author.DialogFrame.currentDialog.editable.type 中找到。类型字段中的路径不是绝对的,并且缺少“/apps 或/libs”部分。如果您对绝对路径感兴趣,请尝试 Granite.author.DialogFrame.currentDialog.editable.config.dialog

关于jquery - 如何在 AEM Touch UI 对话框中查找组件路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55041566/

相关文章:

javascript - 处理 "Cannot read property ' addEventListener' of null"错误的最佳方法

c# - 如何在mvc中使用ajax将数据加载到数据表中

osgi - @Service用于在CQ中创建服务,那么BundleContext.registerService方法有什么用呢?

adobe - 无法删除可编辑模板 AEM 中的组件

java - AEM 将新选项卡添加到 OOTB 页面组件触摸 UI 对话框的对话框

JavaScript + jQuery + Angular : Element is not found

jquery - mmenu.js 自定义宽度设置

java - 为什么即使所有依赖项都已解决,OSGi bundle 仍不启动?

AEM 的富文本 (RTE) 将作者域添加到链接之前?