Edge Delivery Services · 26 of 29
How header/footer and theming actually work in AEM Edge Delivery Services compared to classic AEM. Covers global nav/footer documents vs Experience Fragments, the metadata-driven theme mechanism vs AEM Style System, and a clear feasible-vs-not-feasible comparison for teams learning EDS.
This chapter documents two things that trip up every team moving from classic AEM to Edge Delivery Services (EDS):
For each topic it states plainly: what is possible in EDS, what is not, and how it differs from AEM, so it can be used to explain the model to the team and set correct expectations before a project starts.
This is written from a real POC (naveenrapelly34/eds-poc) where these exact
questions came up.
In EDS, the header and footer are global documents authored once, not components you place on every page.
Every page in an EDS site automatically loads the same header and footer. You do not re-author them per page, and you do not "enable" them through a template or page policy the way you do in AEM.
The boilerplate wires header and footer loading in scripts.js
(loadHeader / loadFooter). The blocks fetch a plain-HTML fragment:
/{nav-path}.plain.html — path comes from the
nav metadata, defaulting to /nav./{footer-path}.plain.html — path comes from the
footer metadata, defaulting to /footer.On every page, the header block requests /nav.plain.html and the footer block requests /footer.plain.html, so the whole site renders one shared header and one shared footer.
So the workflow is:
nav and a page named footer at the site root.nav (in this project using the adc-header-* blocks:
logo, mega-menu, search, language, links).footer.nav once and the whole site updates.Changing the path (optional): if the nav/footer live somewhere other than
/nav and /footer, set the nav and footer metadata (page properties, or a
site-wide metadata sheet). Set it once site-wide so all pages agree.
| Concern | Classic AEM | EDS |
|---|---|---|
| Reuse mechanism | Experience Fragment referenced by the template | /nav and /footer documents fetched by header.js / footer.js |
| How it's enabled on a page | Template structure / page policy | Automatic — wired in scripts.js for every page |
| Where authored | XF console (/content/experience-fragments/...) | Two normal pages (nav, footer) |
| Per-page override | New template / policy | Point nav / footer metadata at a different path |
| Delivery | AEM renders server-side | Static HTML fragment fetched client-side |
Key takeaway to explain to the team: the concept is the same as an Experience Fragment (author once, reuse everywhere), but the mechanism is a plain document fetched by JavaScript — there is no template, no policy, and no "enable in page properties" step.
Possible in EDS
nav / footer
metadata per path (e.g., a microsite with its own nav). ✅nav document. ✅Not the same as AEM
AEM's Style System, template policies, and theme concepts do not exist at EDS delivery time. Theming in EDS is plain CSS that you build yourself.
EDS serves static HTML plus your CSS/JS. There is no AEM rendering at delivery, so there is nothing for an AEM "theme" or "policy" to hook into.
The project implements a custom theme mechanism (not an AEM feature):
theme page-metadata dropdown lets the author pick a value
(e.g. theme1, theme2) — defined in component-models.json.loadTheme() in scripts.js reads the theme metadata, adds a
theme-<value> class to <body>, and loads /styles/themes/<value>.css.Concretely: picking theme2 writes <meta name="theme" content="theme2"> into the page; loadTheme() reads that, adds class="theme-theme2" to <body>, and requests /styles/themes/theme2.css.
This happens when the selected theme's CSS file does not exist. If the
dropdown offers theme2 but there is no styles/themes/theme2.css, the browser
gets a 404, <body> gets the theme-theme2 class with no backing CSS, and any
base styles that depend on theme tokens render unstyled (white).
Fix: every theme option in the dropdown must have a matching
styles/themes/<value>.css file. Add options and CSS files together, never one
without the other.
| Concern | Classic AEM | EDS |
|---|---|---|
| Theme source | Style System, policies, client libs, template config | Plain CSS files + CSS custom properties you author |
| How a theme is selected | Page policy / template / Style System UI | A custom theme metadata field → body class → CSS file |
| Who builds it | Partly provided by AEM framework | 100% built by the project (nothing out of the box) |
| Scope | Component-level style policies | Whole-page tokens via <body> class + variables |
| Runtime | Server-side, AEM-managed | Static CSS, project-managed |
Possible in EDS
Not possible / not the same as AEM
loadCSS), not by cq:ClientLibraryFolder.Bottom line to explain to the team: Theming is fully possible in EDS, but it is a CSS discipline, not an AEM feature. You get more control and better performance, but nothing is provided automatically — you build each theme as a CSS file and wire it through metadata.
| Capability | AEM | EDS | Notes |
|---|---|---|---|
| Global header/footer | Experience Fragment + template | /nav + /footer documents | Author once, auto-loaded |
| Per-page header override | New template/policy | nav / footer metadata | Simpler in EDS |
| "Enable header in page properties" | Template/policy step | Not needed — always on | Wired in scripts.js |
| Style System / component policies | ✅ | ❌ | Replaced by CSS + block options |
| Editable template theme config | ✅ | ❌ | Replaced by metadata + CSS files |
| Named themes | Policies/clientlibs | Custom metadata + styles/themes/*.css | You build it |
| Dark mode / brand tokens | Clientlibs | CSS custom properties | Cleaner in EDS |
| Server-side theme/personalization | ✅ | ❌ | EDS is static; do it client/edge-side |
nav and
footer once; every page loads them automatically. It replaces the
Experience Fragment + template pattern.nav / footer metadata, not
templates.styles/themes/<name>.css provides the tokens. Add the
option and the CSS file together, or the page renders white.This chapter covered theming at a high level. The next chapter, Theming and Theme Inheritance in EDS, goes deeper on the part AEM developers miss most: EDS has no runtime inheritance, so applying one theme to a whole country or folder is a publish-time decision, not a live content tree.
Get an email when I publish the next chapter. No spam — just new technical deep-dives.
Comments
Share feedback or questions about this blog post.
No comments yet. Be the first to share your thoughts.