【问题标题】:How to find the component path in AEM Touch UI Dialog?如何在 AEM Touch UI Dialog 中找到组件路径?
【发布时间】:2019-03-07 10:29:47
【问题描述】:

我想例如在 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 中获取组件路径。

【问题讨论】:

    标签: jquery aem aem-touch-ui


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      正如@sharath-madappa 指出的那样,resourceType 可从Granite.author.DialogFrame.currentDialog.editable.type 获得。

      如果您想要调用对话框的组件的确切路径,可以使用Granite.author.DialogFrame.currentDialog.editable.path

      关于它的更多文档:https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/jsdoc/ui-touch/editor-core/Granite.author.DialogFrame.html

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-03-21
        • 1970-01-01
        • 2021-05-13
        • 1970-01-01
        相关资源
        最近更新 更多