Header, Footer, and Theming — EDS vs AEM
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.
Content Objective
This chapter documents two things that trip up every team moving from classic AEM to Edge Delivery Services (EDS):
- Header and footer — how they are authored and reused across pages.
- Theming — why AEM's Style System / theme concept does not carry over, and what EDS gives you instead.
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.
Part 1 — Header and Footer
The one-line mental model
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.
How it works in this project
The boilerplate wires header and footer loading in scripts.js
(loadHeader / loadFooter). The blocks fetch a plain-HTML fragment:
- Header block fetches
/{nav-path}.plain.html— path comes from thenavmetadata, defaulting to/nav. - Footer block fetches
/{footer-path}.plain.html— path comes from thefootermetadata, 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:
- Create a page named
navand a page namedfooterat the site root. - Author the header on
nav(in this project using theadc-header-*blocks: logo, mega-menu, search, language, links). - Author the footer on
footer. - Publish both.
- Every other page renders that shared header/footer automatically — forever.
Edit
navonce 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.
EDS vs AEM — header/footer
| 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.
Feasible vs not — header/footer
Possible in EDS
- One global header/footer shared across all pages. ✅
- Different header/footer per section by overriding the
nav/footermetadata per path (e.g., a microsite with its own nav). ✅ - Fully custom header markup, mega-menus, search, language switch — all as
blocks authored on the
navdocument. ✅
Not the same as AEM
- No Experience Fragment console, no XF variations/localization UI. ✅ (use separate nav documents per locale instead)
- No template-driven inclusion or editable-template structure locking. ✅
- No server-side personalization of the header at render time (EDS is static; personalization is client-side or edge-side). ⚠️
Part 2 — Theming
The one-line mental model
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.
How theming works in this project
The project implements a custom theme mechanism (not an AEM feature):
- A
themepage-metadata dropdown lets the author pick a value (e.g.theme1,theme2) — defined incomponent-models.json. loadTheme()inscripts.jsreads thethememetadata, adds atheme-<value>class to<body>, and loads/styles/themes/<value>.css.- That CSS file sets the design tokens (CSS custom properties) for the theme.
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.
The classic gotcha — "the page goes white when I pick another theme"
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.
EDS vs AEM — theming
| 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 |
Feasible vs not — theming
Possible in EDS
- Multiple named themes via CSS files + a metadata dropdown. ✅
- Per-page theme selection (author picks in page properties). ✅
- Site-wide default theme via metadata. ✅
- Design tokens / dark mode / brand variants using CSS custom properties. ✅
- Section-level or block-level variants using block option classes. ✅
Not possible / not the same as AEM
- ❌ AEM Style System does not exist — no component style policies UI.
- ❌ Editable template policies do not drive styling.
- ❌ No server-side theme resolution — it's all static CSS + a body class.
- ❌ No client-library category system — CSS/JS are loaded by the boilerplate
loader (
loadCSS), not bycq:ClientLibraryFolder. - ⚠️ Every theme must be hand-authored as CSS; there is no policy UI that generates it for you.
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.
Quick Comparison Cheat-Sheet
| 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 |
How to Explain This to the Team (Talking Points)
- Header/footer are documents, not per-page components. Author
navandfooteronce; every page loads them automatically. It replaces the Experience Fragment + template pattern. - There is no "enable header/footer in page properties." It's wired in code
for the whole site. Overrides happen through
nav/footermetadata, not templates. - AEM theming does not transfer. No Style System, no policies, no client libraries at delivery. EDS is static HTML + CSS.
- Theming is still fully possible — as CSS. A metadata dropdown picks a
theme; a matching
styles/themes/<name>.cssprovides the tokens. Add the option and the CSS file together, or the page renders white. - The trade-off is control vs. convenience. EDS gives you performance and full CSS control, but you build theming yourself instead of getting an AEM framework feature.
Related Chapters
Enjoyed this chapter?
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.