Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

sling:configRef

Avatar

Level 3

Hi Team,

 

As we know to achieve context aware feature, we need to property sling:configRef at JCR content node and point to configuration stores under /conf.

 

My question is : This activity of adding property is always manual activity or is there any way to configure at Page property level through which we can easily select configuration location.

 

Regards,

KTNR 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @arvindpandey 

 

We can add it to the jcr:content of Site Root and commit it to ui.content package.

With filter configuration set to merge/update, we can deploy the config. No manual set-up needed.

 

<jcr:content
cq:allowedTemplates="[/conf/abc/settings/wcm/templates/(?!xf-).*]"
cq:conf="/conf/abc"
jcr:primaryType="cq:PageContent"
jcr:title="ABC Site"
sling:configRef="/conf/abc"
sling:redirect="{Boolean}true"
sling:redirectStatus="{Long}302"
sling:resourceType="foundation/components/redirect"
redirectTarget="/content/abc/se">
<image jcr:primaryType="nt:unstructured">
<file/>
</image>
</jcr:content>

 


Aanchal Sikka

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hello @arvindpandey 

 

We can add it to the jcr:content of Site Root and commit it to ui.content package.

With filter configuration set to merge/update, we can deploy the config. No manual set-up needed.

 

<jcr:content
cq:allowedTemplates="[/conf/abc/settings/wcm/templates/(?!xf-).*]"
cq:conf="/conf/abc"
jcr:primaryType="cq:PageContent"
jcr:title="ABC Site"
sling:configRef="/conf/abc"
sling:redirect="{Boolean}true"
sling:redirectStatus="{Long}302"
sling:resourceType="foundation/components/redirect"
redirectTarget="/content/abc/se">
<image jcr:primaryType="nt:unstructured">
<file/>
</image>
</jcr:content>

 


Aanchal Sikka