Как найти путь к компоненту в AEM Touch UI Dialog?

Я хочу, например, выбрать путь /content/branc/region/microsite_name/en/mypage/jcr:content/par/mycomponent в jQuery.

Я могу получить путь к странице, используя 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.

2 ответа

Тип ресурса доступен в Granite.author.DialogFrame.currentDialog.editable.type, Путь в поле типа не является абсолютным и не содержит части '/apps или /libs'. Если вы заинтересованы в абсолютном пути, попробуйте Granite.author.DialogFrame.currentDialog.editable.config.dialog

Как указывает @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

Другие вопросы по тегам