我试图避免UI中特定文件夹下的重复标题(jcr: title )。是否有任何CQ.Ext js get方法来获取文件夹下的所有节点并循环遍历每个节点的jcr:title?
CQ.utils.HTTP.get(parentPath + "/jcr:content/jcr:title");
这将只获得一个特定节点的标题。
发布于 2013-12-30 12:06:16
您可以使用.2.选择器获取一个页节点及其所有子节点和子jcr:content节点。迭代响应JSON以获得每个页面的jcr:title属性。
下面的代码使用jQuery $.map来避免创建额外的数组:
$CQ.map(CQ.Util.eval('/content/geometrixx/en.2.json'), function(v) {
if (typeof v['jcr:content'] != 'undefined') {
return v['jcr:content']['jcr:title'];
}
});
>> ["Toolbar", "Products", "Services", "Company", "Events", "Support", "Community", "GeoBlog"]https://stackoverflow.com/questions/20838576
复制相似问题