Custom Headers and Footers in Experience Fragments for Specific Pages (Document-Based Authoring in EDS) | Community
Skip to main content
Level 2
March 17, 2025
Solved

Custom Headers and Footers in Experience Fragments for Specific Pages (Document-Based Authoring in EDS)

  • March 17, 2025
  • 1 reply
  • 501 views

I am currently using auto-generated Experience Fragments for the header and footer across multiple pages in AEM with document-based authoring (EDS). However, I need to apply different headers and footers for specific pages instead of using the same auto fragments everywhere. Is there a way to define custom Experience Fragments for the header and footer for certain pages while using document-based authoring? If so, what would be the best approach to achieve this?

Best answer by narendiran_ravi

You can define the metadata for your page nav or footer with the value of the custom header fragment page.

 

As you can see in boilerplate code -https://github.com/adobe/aem-boilerplate/blob/878dbbb7e4382c1b0ba6854442983c63bed51d1d/blocks/header/header.js#L112  and https://github.com/adobe/aem-boilerplate/blob/878dbbb7e4382c1b0ba6854442983c63bed51d1d/blocks/footer/footer.js#L10  they are reading the metadata called nav or footer for header and footer respectively. 

1 reply

narendiran_ravi
narendiran_raviAccepted solution
Level 6
March 17, 2025

You can define the metadata for your page nav or footer with the value of the custom header fragment page.

 

As you can see in boilerplate code -https://github.com/adobe/aem-boilerplate/blob/878dbbb7e4382c1b0ba6854442983c63bed51d1d/blocks/header/header.js#L112  and https://github.com/adobe/aem-boilerplate/blob/878dbbb7e4382c1b0ba6854442983c63bed51d1d/blocks/footer/footer.js#L10  they are reading the metadata called nav or footer for header and footer respectively.