Context Aware Configurations:Context Path Strategies | Community
Skip to main content
Umesh_Thakur
Community Advisor
Community Advisor
September 24, 2024
Solved

Context Aware Configurations:Context Path Strategies

  • September 24, 2024
  • 1 reply
  • 1228 views

Dear Members,

We are using XFs for header and footer, these Xfs are being authored with respective components. We wanted to use context aware configuration for some site specific data. To implement it we need to add "sling:configRef" property to the root of every locale for Pages as well as Xfs. Since site is already live with AEM as CS and we don't want to make any change for sling:configRef on content so planing to use io.wcm Context Path Strategies so do you think this will be helpful for this requirement if yes then how can I proceed with it for Xfs and pages.

Waiting for your suggestion.
Thank you

Umesh Thakur

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 arunpatidar

Hi @umesh_thakur 
You can add @sling:configRef to root of your site(/content/myite), no need to add to every local.

e.g. Content and conf strategy

/content/myite/de

/content/myite/fr

 

/conf/myite/de

/conf/myite/fr

 

If you want to reuse config within XF editor then@sling:configRef to root of your XF and modify contextPathRegex

contextPathRegex="^/content(/.+)?$|^/content/experience-fragments(/.+)?$"

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
September 24, 2024

Hi @umesh_thakur 
You can add @sling:configRef to root of your site(/content/myite), no need to add to every local.

e.g. Content and conf strategy

/content/myite/de

/content/myite/fr

 

/conf/myite/de

/conf/myite/fr

 

If you want to reuse config within XF editor then@sling:configRef to root of your XF and modify contextPathRegex

contextPathRegex="^/content(/.+)?$|^/content/experience-fragments(/.+)?$"
Arun Patidar
Umesh_Thakur
Community Advisor
Community Advisor
September 24, 2024

Thank you for the response @arunpatidar .

Will implement the same way.