How to safely update the sling:configRef property | Community
Skip to main content
Level 2
June 23, 2025
Solved

How to safely update the sling:configRef property

  • June 23, 2025
  • 1 reply
  • 331 views

Hi Team,

How do you safely update the sling:configRef property of a page template structure in AEM as a Cloud Service, given that direct editing of /conf in Cloud Service is discouraged, and doing it incorrectly can break template-based content inheritance?

Best answer by SantoshSai

Hi @omarkh3,

In Cloud, updating the sling:configRef on a page template (especially when using editable templates) should NOT be done manually via CRXDE or page property dialogs in Cloud environments. Instead, the recommended way is:

1. Define the configRef at the Template-Level Structure Node

This ensures all pages created from that template inherit the configuration cleanly.

Set it under:

/conf/<site>/settings/wcm/templates/<template>/structure/jcr:content

Example:

"sling:configRef" = "/conf/my-site/settings"

Push this via code in the ui.content module, not via in-author changes.

2. Avoid Setting configRef on Root Pages

If you also set it on the actual root page (e.g., /content/my-site), it can override the structure-level inheritance, causing issues with policies, styles, or context-aware configs.

Instead, let it flow from the template structure node.

3. Use Context-Aware Configuration (/conf) Properly
  • Organize per site/language/country: /conf/site-ca, /conf/site-fr, etc.

  • Avoid reusing a single /conf/global across unrelated templates — this leads to maintainability and inheritance conflicts in AEMaaCS.

1 reply

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
June 23, 2025

Hi @omarkh3,

In Cloud, updating the sling:configRef on a page template (especially when using editable templates) should NOT be done manually via CRXDE or page property dialogs in Cloud environments. Instead, the recommended way is:

1. Define the configRef at the Template-Level Structure Node

This ensures all pages created from that template inherit the configuration cleanly.

Set it under:

/conf/<site>/settings/wcm/templates/<template>/structure/jcr:content

Example:

"sling:configRef" = "/conf/my-site/settings"

Push this via code in the ui.content module, not via in-author changes.

2. Avoid Setting configRef on Root Pages

If you also set it on the actual root page (e.g., /content/my-site), it can override the structure-level inheritance, causing issues with policies, styles, or context-aware configs.

Instead, let it flow from the template structure node.

3. Use Context-Aware Configuration (/conf) Properly
  • Organize per site/language/country: /conf/site-ca, /conf/site-fr, etc.

  • Avoid reusing a single /conf/global across unrelated templates — this leads to maintainability and inheritance conflicts in AEMaaCS.

Santosh Sai