Hide inherited property in page properties dialog (Touch UI) | Community
Skip to main content
Level 2
August 20, 2020
Solved

Hide inherited property in page properties dialog (Touch UI)

  • August 20, 2020
  • 3 replies
  • 5222 views

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 tried using sling:hideChildren, but did not manage to accomplish it. I also tried this example from Adobe, but it does not work at all.

https://github.com/Adobe-Marketing-Cloud/aem-authoring-extension-page-dialog

 

Any ideas?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sardinchen

I managed to find a solution and actually the example from Adobe works with adjustments 🙂

 

You have to use the Sling Resource Merger with /mnt/override and an absolute path to inherit from the parent super component.

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

 

In the XML for the tabs, all properties can be used as expected. For example:

<?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>
</items>
</column>
</items>
</jcr:root>

 

It is essential to use the Sling Resource Merger with an override and to use an absolute path there! 

3 replies

Nikhil-Kumar
Community Advisor
Community Advisor
August 20, 2020

@sardinchen  
Try using the property sling:hideProperties.

Level 2
August 20, 2020
@nikhil-kumar Do you have a more detailed example explicitly for targeting properties from an include? I'm having the problem, that I cannot target the property inside the inherited tab, even if I would write a render condition, I'd still need to target that property somehow.
Level 2
August 20, 2020

I managed to find a solution and actually the example from Adobe works with adjustments 🙂

 

You have to use the Sling Resource Merger with /mnt/override and an absolute path to inherit from the parent super component.

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

 

In the XML for the tabs, all properties can be used as expected. For example:

<?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>
</items>
</column>
</items>
</jcr:root>

 

It is essential to use the Sling Resource Merger with an override and to use an absolute path there! 

sardinchenAuthorAccepted solution
Level 2
August 20, 2020

I managed to find a solution and actually the example from Adobe works with adjustments 🙂

 

You have to use the Sling Resource Merger with /mnt/override and an absolute path to inherit from the parent super component.

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

 

In the XML for the tabs, all properties can be used as expected. For example:

<?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>
</items>
</column>
</items>
</jcr:root>

 

It is essential to use the Sling Resource Merger with an override and to use an absolute path there! 

Level 2
April 8, 2024

Hi @sardinchen 

title override is working but moretitles is not overriding. I tried various permutation and combination but still its not working. Could you please help. I tried to keep at both places

 

Level 2
April 12, 2024

Hey @harsharya 

In your screenshot you are using /mnt/overlay with a relative path while for me using /mnt/override along with an absolute path (starting with /apps or /libs) fixed the problem. Did you already happen to try that?