jquery - 如何在 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 中获取组件路径。
解决方案
资源类型在Granite.author.DialogFrame.currentDialog.editable.type
. 类型字段中的路径不是绝对的,并且缺少“/apps 或 /libs”部分。如果您对绝对路径感兴趣,请尝试Granite.author.DialogFrame.currentDialog.editable.config.dialog
推荐阅读
- c# - 如何在使用 linq 和实体框架核心时修复“发现歧义匹配”
- javascript - 我应该测试 Vue.js 的私有函数吗?
- css - 如何有条件地更改角度组件中的样式 url?可能吗?
- html - 锚标记在其内联 img 元素后导致右侧空间如何删除它并正确对齐菜单项
- html - 我想将搜索栏对齐到最右边
- google-chrome - 更改 Chrome 中的安全设置以允许不受限制的蓝牙访问
- kotlin - 滑行:左上角和右上角
- javascript - 得到
- python - Python中SAS的PROBIT函数等价
- excel - Excel:比较两个 csv 文件,并将行数据与相应列隔离