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