sling:configRef | Community
Skip to main content
July 5, 2023
Solved

sling:configRef

  • July 5, 2023
  • 1 reply
  • 851 views

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 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aanchal-sikka

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>

 

1 reply

aanchal-sikka
Community Advisor
aanchal-sikkaCommunity AdvisorAccepted solution
Community Advisor
July 5, 2023

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