Overlaying page dialog in AEM | Community
Skip to main content
Level 3
January 13, 2025

Overlaying page dialog in AEM

  • January 13, 2025
  • 6 replies
  • 1907 views

Hi,

I would like to add some new fields to the page dialog's basic tab.
To do that I have defined the overlay for the page dialog xml at /apps/core/wcm/components/page/v3/page/_cq_dialog/content.xml .
This contains 

<content
granite:class="cq-dialog-content-page"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<tabs
granite:class="cq-siteadmin-admin-properties-tabs"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/tabs"
size="L">
<items jcr:primaryType="nt:unstructured">
<basic
jcr:primaryType="nt:unstructured"
jcr:title="Basic"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
< HERE ARE MY FIELDS DEFINED >

These fields are displayed now on the page dialog, but my issue is that the basic tab fields from /libs/core/wcm/components/page/v3/page/_cq_dialog/content.xml
are missing.

I would expect that the items from /libs/ folder are displayed as well.
What do I miss?

Thanks,
Peter

 

 

 

 

6 replies

gkalyan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
January 13, 2025

@pnagy 

To create an overlay or override you need to recreate the original node, with the equivalent structure, under the destination (usually /apps). You can use sling resource merger to 

 

Check this Adobe user guide for creating the overlay structure:

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/developing/platform/sling-resource-merger#creating-the-structure

 

Use the below to add/hide/change properties

https://experienceleague.adobe.com/en/docs/experience-manager-65/content/implementing/developing/platform/sling-resource-merger#use-cases

pnagyAuthor
Level 3
January 13, 2025

@gkalyan thanks for the urls, I already went through them.
This is what I have in JCR for the overlay in /apps:

 

 

 

And in /libs:

 

I have the same structure, but the nodes from /libs/.. (e.g. branding) are not displayed.
I still don't see why they would not be shown.

Shubham_borole
Community Advisor
Community Advisor
January 13, 2025

Hi @pnagy , not sure if complete overlay to apps is required to add to page properties basic tab. You can point (resourcesuperType it)  your /apps/project/components/page/content.xml to  core/wcm/components/page/v3/page. (Similar to this wknd example)
and add a cq:dialog node under your 'page' node. Under that you can add the structure you have mentioned above.

 

this should merge the properties and show the custom added properties and the ootb coming from page v3

pnagyAuthor
Level 3
January 14, 2025

Hi @shubham_borole ,
so you mean it's not possible to add new properties to core/wcm/components/page/v3/page's dialog's basic tab under /apps/core/wcm/components/page/v3/page/_cq_dialog/.content.xml without redefining the existing ones?

kapil_rajoria
Community Advisor
Community Advisor
January 14, 2025

Hi @pnagy, I would suggest you to make your own custom component and set its resourceSuperType to the OOTB page component.
Then download the OOTB page package dialog by making a package from crxde and copy the whole code and paste in the _cq_dialog >.content.xml of your custom component and make your changes in that.

SreenivasBr
Level 4
January 14, 2025

Hi

It is not recommended to make updates to the core components. Instead create a page component in your project eg: /apps/<project-name>/components/structure/page for which the sling:resourceSuperType will be core/wcm/components/page/v3/page. And then you can create the cq:dialog under this page component with your additional changes.

Also, there is nothing called libs/core/wcm/components.

AmitVishwakarma
Community Advisor
Community Advisor
January 19, 2025

To fix the issue of missing fields from /libs/core/wcm/components/page/v3/page/_cq_dialog/content.xml when overlaying the page dialog:

  1. Ensure inheritance: Ensure your overlay doesn't completely replace the fields from /libs. It should inherit from /libs and only add new fields.

  2. Correct overlay path: Verify the overlay is at /apps/core/wcm/components/page/v3/page/_cq_dialog/content.xml.

  3. Keep existing structure: Don’t override the entire <items> or <basic> structure from /libs, as this may hide default fields.

  4. Clear cache: After updating, clear AEM cache and re-activate the page to apply changes.

This ensures the default fields from /libs show along with your custom fields.

kautuk_sahni
Community Manager
Community Manager
January 27, 2025

@pnagy Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni