I'd like to hide a property within a certain tab that is inherited from /libs/wcm/foundation/components/basicpage/v1/basicpage (e.g. hideInNav property in basic tab).
This change should only affect one page-rendering component, so I don't want to do an overlay of the Foundation page dialog in /apps/foundation/components/basicpage/v1/basicpage/tabs/basic. Therefore I tried using sling:hideChildren, but I did not manage to accomplish to make it work.
<?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>
Okay, figured out a solution (for AEM 6.4). You have to use the Resource Merger with an override:
The override is absolutely necessary to merge the properties from the inherited page with the properties of the super/parent page! And it requires an absolute path.
<basic jcr:primaryType="nt:unstructured" path="/mnt/override/apps/[...]/components/basepage/tabs/basic"/>
The XML file of the tabs works as you would expect it to work and you can use sling:hideChildren and all the other properties:
<?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>
Example from Adobe. This commit helped me understand the differences between 6.1 and 6.4: https://github.com/Adobe-Marketing-Cloud/aem-authoring-extension-page-dialog/commit/aaa6035c8cdfcfaeb5e2157be436e1fccfbe22db