Expand my Community achievements bar.

SOLVED

Template management for multi country/language setup

Avatar

Level 4

Hi all,

Hope you are doing well!

We want to set up other countries/languages based on our Master one. We have header and footer added on our templates. But, when we create e.g. a Spanish page(inside Spanish language root), we can not use the same header as the English one. But, inside templates we have added the header and footer of the English one. What would be the best solution for to manage templates? Should we create templates for each language of each country, and add the specific header to each template? Or is there any other approach? Because, creating templates for each language, by the end there will be a lot of templates. Thanks!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You can try to use the localization feature of the core experience fragment(define header and footer through experience fragment) to achieve your scenario with the same template.

 

Refer to https://www.albinsblog.com/2021/02/how-to-reuse-editable-template-with-multiple-sites-in-aem.html for more details

 

Regards

Albin I

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @AD-Engineer ,

 

If you are using Experience Fragments (for Header and Footer) it is not required to have separate templates for each languages. We just need to have different experience fragments for each languages following the same structure creation used for sites. Though we would have configured one of the languages say English (en) XF in structure mode of editable templates and when we are in Spanish page, XF will try to find the localised version(Spanish) of Header and footer (XF) and if its available it will render Spanish Header and footer, else it will fallback to English.

 

Fallback conditions.

  1. First it tries to find a language root.
  2. If not found, it tries to find a blueprint.
  3. If not found, it tries to find a live copy.
  4. If not found, it defaults to the experience fragment configured in the component.

Please refer below doc for more details https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/experien... 

Avatar

Correct answer by
Community Advisor

You can try to use the localization feature of the core experience fragment(define header and footer through experience fragment) to achieve your scenario with the same template.

 

Refer to https://www.albinsblog.com/2021/02/how-to-reuse-editable-template-with-multiple-sites-in-aem.html for more details

 

Regards

Albin I