Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

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

jayv25585659
Level 6
Level 6

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>


 

7 Replies
asutosh_jena
Community Advisor
Community Advisor

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!

jayv25585659
Level 6
Level 6

I was following this tutorial/guide (https://experienceleague.adobe.com/docs/experience-manager-learn/sites/developing/page-properties-te...) and it was telling me to use /apps/my-app-folder/

Can you please link me to a tutorial/documentation that uses /apps/wcm path? thanks

EDIT:
(just to clarify)
1. existing fields goes into /apps/my-demo-app/../../

2. new fields goes into /apps/wcm/../../
Is this correct?

asutosh_jena
Community Advisor
Community Advisor
Are you using the core components now and trying to add an additional property as described in the video?
asutosh_jena
Community Advisor
Community Advisor
Are you using the core components now and trying to add an additional property as described in the video? If Yes, then you will need to overlay the node in /apps/your-project-folder and then add only the additional property.
jayv25585659
Level 6
Level 6

As mentioned above, I was trying to add new fields into an existing fieldset. using the video tutorial, I was able to hide a built-in/default field (Facebook ID) in the social tab.

How do I know if the changes goes to /apps/my-app-here or /apps/wcm?

Thanks!

asutosh_jena
Community Advisor
Community Advisor
You the implementation is required only for a single website or project that you are working on, in this case you can add the additional property in the /apps/myproject folder. As you are using the sling:resourceSuperType property it will inherit the additional property that you have created and will show on your page. If you want it to be available for all the future projects including the exisitng one without making any additional change each time you add a project, you can overlay in /apps/wcm and it will be available for all the projects.
jayv25585659
Level 6
Level 6

Thanks for the clarification. Are you able to explain the results of my test? I would've expected it to work like in the tutorial.

Thanks again