在页面属性对话框(触摸UI)中隐藏继承的属性



我想在某个选项卡中隐藏从/libs/wcm/foundation/components/basicpage/v1/basicpage继承的属性(例如,基本选项卡中的hideInNav属性(。

此更改应该只影响一个页面呈现组件,因此我不想覆盖/apps/Foundation/components/basicpage/v1/basicpage/tabs/basic中的Foundation页面对话框。因此,我尝试使用吊带:hideChildren,但我没能成功。

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured">
<content jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<tabs jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<basic jcr:primaryType="nt:unstructured">
<!-- that does not work either -->
<items jcr:primaryType="nt:unstructured" sling:hideChildren="*">
<column jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<title jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<!-- that does not work -->
<title jcr:primaryType="nt:unstructured" sling:hideProperties="*"/>
</items>
</title>
<!-- that does not work -->
<moretitles
cq:showOnCreate="{Boolean}false"
cq:hideOnEdit="{Boolean}true"
jcr:primaryType="nt:unstructured">
</moretitles>
</items>
</column>
</items>
</basic>
<!-- that works -->
<advanced jcr:primaryType="nt:unstructured" sling:hideResource="{Boolean}true"/>
</items>
</tabs>
</items>
</content>
</jcr:root>

好的,找到了一个解决方案(针对AEM 6.4(。你必须使用带有覆盖的资源合并:

将继承页面的属性与超级/父页面的属性合并时,绝对需要重写!它需要一条绝对的道路

<basic jcr:primaryType="nt:unstructured" path="/mnt/override/apps/[...]/components/basepage/tabs/basic"/>

选项卡的XML文件按照您期望的方式工作,您可以使用sling:hideChildren和所有其他属性:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<column jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured">
<title jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured" sling:hideChildren="[hideinnav]" />
</title>
<moretitles jcr:primaryType="nt:unstructured">
<items jcr:primaryType="nt:unstructured" sling:hideChildren="[pagetitle,navigationtitle,subtitle]"/>
</moretitles>
</items>
</column>
</items>
</jcr:root>

Adobe的示例。这一承诺帮助我理解了6.1和6.4之间的区别:https://github.com/Adobe-Marketing-Cloud/aem-authoring-extension-page-dialog/commit/aaa6035c8cdfcfaeb5e2157be436e1fccfbe22db

最新更新