Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Hide Particular field in page properties Dialog.

Avatar

Level 2

Hi Team,
I would like to hide some fields in page properties dialog. which is coming from OOB page properties.

for example: hide SEO [OOB] option from Advanced Tab in page properties dialog.

TushaarSrivastava_0-1638119254243.png

 

Scenario:
I have created a page by inheriting core/cif/components/structure/page/v1/page

TushaarSrivastava_0-1638120371201.png

 

 

which is then inheriting from "/libs/core/wcm/components/page/v3/page"
which is finally inheriting from: "/libs/wcm/foundation/components/basicpage/v1/basicpage"

So, my Adnavced tab is coming from: /libs/wcm/foundation/components/basicpage/v1/basicpage/cq:dialog/content/items/tabs/items/advanced
i.e. /libs/wcm/foundation/components/basicpage/v1/basicpage/tabs/advanced

 

Now requirement here is to Hide SEO from Advanced tab.



I tried to copy the advanced tab and SEO node and used sling:hideResource true to hide, but then I cannot see any fields in Advance tab.

So how to hide only SEO node from OOB Advanced tab.

@kautuk_sahni  @arunpatidar   @Vijayalakshmi_S  @Himanshu_Singhal 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

1. Create a dialog cq:dialog

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root 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">
                    <advanced
                        jcr:primaryType="nt:unstructured"
                        path="/mnt/override/apps/aemlab/components/page/tabs/advanced"/>
                </items>
            </tabs>
        </items>
    </content>
</jcr:root>

 

2. Create a tabs node with advanced tab and hide as a resource e.g. configuration properties

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/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">
    <advanced
        jcr:primaryType="nt:unstructured"
        jcr:title="Advanced">
        <items jcr:primaryType="nt:unstructured">
            <column
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/container">
                <items jcr:primaryType="nt:unstructured">
                    <configuration
                        jcr:primaryType="nt:unstructured"
                        sling:hideResource="{Boolean}true"/>
                </items>
            </column>
        </items>
    </advanced>
</jcr:root>


Arun Patidar

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

1. Create a dialog cq:dialog

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root 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">
                    <advanced
                        jcr:primaryType="nt:unstructured"
                        path="/mnt/override/apps/aemlab/components/page/tabs/advanced"/>
                </items>
            </tabs>
        </items>
    </content>
</jcr:root>

 

2. Create a tabs node with advanced tab and hide as a resource e.g. configuration properties

 

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/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">
    <advanced
        jcr:primaryType="nt:unstructured"
        jcr:title="Advanced">
        <items jcr:primaryType="nt:unstructured">
            <column
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/container">
                <items jcr:primaryType="nt:unstructured">
                    <configuration
                        jcr:primaryType="nt:unstructured"
                        sling:hideResource="{Boolean}true"/>
                </items>
            </column>
        </items>
    </advanced>
</jcr:root>


Arun Patidar

Avatar

Level 2

Thank you It worked . I am new to this concept. could you please help me with any Adobe document for the same. 

Avatar

Community Advisor

Hi @TushaarSrivastava 

There are no Adobe documentation for this specific use case but you can follow the implementation of supertype page resource. there tabs are included via path.

here we just did the same



Arun Patidar

Avatar

Community Advisor

@TushaarSrivastava,

In OOTB advanced node of cq:dialog - /libs/wcm/foundation/components/basicpage/v1/basicpage/cq:dialog/content/items/tabs/items/advanced, is included using "include resource" with path being mount overlay path /mnt/overlay/wcm/foundation/components/basicpage/v1/basicpage/tabs/advanced

Mount overlay path works by merging resources using search paths - That is per this path, it will first look in /apps/wcm/foundation/components/basicpage/v1/basicpage/tabs/advanced. If there is no resource there, then it will look in /libs/wcm/foundation/components/basicpage/v1/basicpage/tabs/advanced. 

This gives us an another option of amending the advanced tab by overlaying it to apps.

Solution shared by @arunpatidar based on Mount override works by merging resources based on super type. 

Official documentation for referencehttps://experienceleague.adobe.com/docs/experience-manager-64/developing/platform/sling-resource-mer...