Landmarks and headings
This page is for designers who write the pagelayout and view templates. Screen reader users jump between landmarks and headings the way sighted users scan a page. The page answers: which landmarks a page needs and how to keep headings in order across pagelayout, views and layout blocks.
Contents
Landmarks in the pagelayout
<body>
<a class="skip-link" href="#main">'Skip to main content'|i18n( 'design/mytheme' )</a>
<header class="site-header">
<a class="site-name" href='/'|ezurl>$site.title|wash</a>
<nav aria-label="'Main navigation'|i18n( 'design/mytheme' )">...</nav>
</header>
<main id="main" tabindex="-1">
$module_result.content
</main>
<footer class="site-footer">...</footer>
</body>- Exactly one
<main>.tabindex="-1"lets the skip link move focus into it. <header>and<footer>directly in<body>are the page's banner and content info.- Side content goes in
<aside>.
admin4 uses the same structure with roles on div elements: role="banner", role="main" (with tabindex="-1"),
role="navigation" with aria-label for the breadcrumb, role="complementary" for the tools column,
role="contentinfo" (design/admin4/templates/pagelayout.tpl).
Labeling repeated landmarks
When a page has more than one <nav> (main menu, breadcrumb, footer links, paging), give each a translated
aria-label, so the list of landmarks reads "Main navigation, Breadcrumb, Footer".
Headings
- One
<h1>per page: the title of the content. In a content view, the full view template prints it; the pagelayout does not (the site name in the header is not an<h1>on content pages). - No skipped levels:
h1, thenh2, thenh3. Choose the element by structure and style it with classes, not the other way round. - Line views and teasers in a list under an
h2useh3for their titles. - Rich text: editors' headings start at the level the datatype template gives them; check how your
ezxmltags/header.tplmaps levels if you override it.
Headings in layouts
Pages built with the layouts editor are composed of blocks; each block template decides its own heading element. The
layouts extension's block/title.tpl takes the element from the block (tag, or h plus level), so the editor
chooses it. In your block templates:
- give list and grid blocks a configurable heading level, or use
h2for block titles andh3for items; - make sure the page still has exactly one
h1, usually from a title or full-view block.
Checks
- To do: A landmarks list (browser extension or screen reader rotor) shows banner, navigation(s), main, content info.
- To do: Each navigation has a distinct name.
- To do: Headings list starts with one
h1and has no jumps. - To do: Error pages and search pages have an
h1too.
Related pages
- Skip links
- The pagelayout
- Block view templates
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.