AEM 6.5.6 + static templates: How do I extend a fieldset in default page properties?

Avatar

Avatar

jayv25585659

Avatar

jayv25585659

jayv25585659

16-03-2021

So I was looking at /libs/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/column/items/moretitles (The contents of this node is shown below).

I want to add another field in this fieldset.

Can you please help? Thanks

 

Edit1: I was following this tutorial/guide when I made my changes/tests: https://experienceleague.adobe.com/docs/experience-manager-learn/sites/developing/page-properties-te... Following this tutorial, I was able to hide one of the build-in/default field in social tab/WKND page template.

 

Update1:

  • Things begin to work for me when I added sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage/tabs/basic" to my basic.xml jcr:root.
  • I tried to do the similar thing ( sling:resourceSuperType="wcm/foundation/components/basicpage/v1/basicpage/tabs/advanced) for advanced.xml and it's definitely not working.

As a test, I tried 2 things (in both test, the nodes were saved in /apps/myapp/components/page/base-page/cq:dialog/content/items/tabs/items/basic/items/column/items/moretitles)

  1. 1st test
    <moretitles
    jcr:primaryType="nt:unstructured">
    <items jcr:primaryType="nt:unstructured">
    <pagetitle1
    cq:showOnCreate="{Boolean}true"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldLabel="Page Title1"
    name="./pageTitle1"
    renderReadOnly="{Boolean}true">
    <granite:data
    jcr:primaryType="nt:unstructured"
    allowBulkEdit="{Boolean}true"
    cq-msm-lockable="pageTitle1"/>
    </pagetitle1>
    </moretitles>
    The problem with test1 is that I cannot see pageTitle1 in page creation and after creation (Open page properties) but I can see other default fields (example: navTitle).

  2. 2nd test (this is basically a copy of pageTitle from /libs/../../moretitles except I've appended 1)
    <moretitles
    cq:showOnCreate="{Boolean}true"
    jcr:primaryType="nt:unstructured"
    jcr:title="More Titles and Description"
    sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
    <items jcr:primaryType="nt:unstructured">
    <pagetitle1
    cq:showOnCreate="{Boolean}true"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldLabel="Page Title1"
    name="./pageTitle1"
    renderReadOnly="{Boolean}true">
    <granite:data
    jcr:primaryType="nt:unstructured"
    allowBulkEdit="{Boolean}true"
    cq-msm-lockable="pageTitle1"/>
    </pagetitle1>
    </moretitles>
    In the 2nd test, I can finally see pageTitle1 in page creation and after creation (Open page properties) BUT all the other default fields (example: navTitle) have disappeared. Instead of extending moretitles, it seems I've overridden/replaced it.

(contents of /libs/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/column/items/moretitles)

<moretitles
cq:showOnCreate="{Boolean}true"
jcr:primaryType="nt:unstructured"
jcr:title="More Titles and Description"
sling:resourceType="granite/ui/components/coral/foundation/form/fieldset">
<items jcr:primaryType="nt:unstructured">
<pagetitle
cq:showOnCreate="{Boolean}true"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Page Title"
name="./pageTitle"
renderReadOnly="{Boolean}true">
<granite:data
jcr:primaryType="nt:unstructured"
allowBulkEdit="{Boolean}true"
cq-msm-lockable="pageTitle"/>
</pagetitle>
<navigationtitle
cq:showOnCreate="{Boolean}true"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
allowBulkEdit="{Boolean}true"
fieldLabel="Navigation Title"
name="./navTitle"
renderReadOnly="{Boolean}true">
<granite:data
jcr:primaryType="nt:unstructured"
allowBulkEdit="{Boolean}true"
cq-msm-lockable="navTitle"/>
</navigationtitle>
<subtitle
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
fieldLabel="Subtitle"
name="./subtitle"
renderReadOnly="{Boolean}true">
<granite:data
jcr:primaryType="nt:unstructured"
allowBulkEdit="{Boolean}true"
cq-msm-lockable="subtitle"/>
</subtitle>
<description
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
fieldLabel="Description"
name="./jcr:description"
renderReadOnly="{Boolean}true">
<granite:data
jcr:primaryType="nt:unstructured"
allowBulkEdit="{Boolean}true"
cq-msm-lockable="jcr:description"/>
</description>
</items>
</moretitles>


 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar

asutosh_j3

Avatar

asutosh_j3

asutosh_j3

16-03-2021

Hi @jayv25585659 

As you are trying to add a new field in the fieldset you will need to overlay the node under 'apps' folder. Overlay should be created using the below path:
/apps/wcm/foundation/components/basicpage/v1/basicpage/tabs/basic/items/column/items/moretitles/items/custompropertynamehere

Hope this helps!
Thanks!