Template management for multi country/language setup | Community
Skip to main content
Level 3
August 18, 2021
Solved

Template management for multi country/language setup

  • August 18, 2021
  • 3 replies
  • 1553 views

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!

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 AlbinIs1

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

3 replies

Kishore_Kumar_
Level 9
August 19, 2021

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/experience-fragment.html?lang=en 

Bhuwan_B
Community Advisor
Community Advisor
August 19, 2021
AlbinIs1Community AdvisorAccepted solution
Community Advisor
August 19, 2021

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