theme.html
Status: done (100%)
What it is
theme.html is the shared page wrapper of the HTML layout system (e107 v2.2.2+). It is the only file in the theme that contains the <body> tag. Core loads it in e_theme::loadLayout() together with the current layout file — both must exist, otherwise core silently falls back to legacy theme.php layouts.
<body class="{LAYOUT_ID} {BODY_CLASS}" {BODY_ONLOAD}>
<div class="page {PAGE_CLASS}">
{---HEADER---}
{---LAYOUT---}
{---MODAL---}
{---FOOTER---}
</div>
</body>{---LAYOUT---} — the split marker
Core splits theme.html at {---LAYOUT---} into the internal _header_ and _footer_ parts. Everything above the marker is rendered before the current layout, everything below after it. The marker itself is replaced by the content of layouts/<name>_layout.html (see Theme layouts).
The body tag
{LAYOUT_ID}— core placeholder, outputs the current layout name as a body class (home,page, ...). Useful for per-layout CSS.{BODY_CLASS}— Aragorn theme shortcode supplying extra per-layout body classes (thehomelayout gets Tabler marketing'sbody-marketing body-gradientpage background).theme.htmlis shared by all layouts, so these classes cannot be hard-coded here.
sc_body_class() must read THEME_LAYOUT via defset() inside the method, never cache it in the constructor — the shortcode batch is a singleton that can be instantiated before the constant exists. The full explanation is in Theme layouts.
{BODY_ONLOAD}— core placeholder for legacy onload attributes.
The .page wrapper
Tabler's structural root .page lives here — not in the layout files — because the {---HEADER---} partial must render inside it (Tabler structure: .page > header > .page-wrapper). The structural class page is hard-coded; per-layout modifiers come from the {PAGE_CLASS} theme shortcode (the auth layout returns page-center, producing .page.page-center for the centered auth pages). Keeping page hard-coded is deliberate defence: if the shortcode ever returns nothing, the page loses a modifier, not its skeleton.
Other markers and shortcodes in theme.html
{---HEADER---}/{---FOOTER---}— replaced by core with the parsed output of the{HEADER}/{FOOTER}theme shortcodes, which load the HTML partials fromheaders/andfooters/. Documented on Header & footer partials and in detail in the guide.{---MODAL---}— core placeholder for the modal container markup.
When theme.html is NOT used
Two core render paths bypass the whole HTML layout system — expect neither theme.html nor any layout file to apply there:
e_IFRAMEmode —login.phpby default, andfpw.php/signup.phpwhen Members only is enabled. Core discards the theme's header/footer and printse_IFRAME_HEADER/e_IFRAME_FOOTERfrom the page templates instead; with an HTML-layout theme the page then has no<body>tag at all. How the auth pages deal with this is documented on Auth pages.Maintenance mode — guests are redirected to
sitedown.php, whose template supplies its own complete HTML document including all CSS links. See Sitedown page.
Last updated