Blog Editor template guide

Every entry has the same markup on every site. The templates below decide how it looks on this one.

Where the templates go

A template is a page under /OpenForum/PageTemplates with a page.html.template file, such as /OpenForum/PageTemplates/BlogEntry/page.html.template. A site can have any number of them.

The plain default templates are used until you choose others. Open Settings in the Blog Editor, choose the entry template and the blog page template, and save. After changing a template file, press Render all entries again there.

Fields

FieldWhat it holds
&content;The entry, or the list of entries. Every template needs it once.
&title;The entry title, or the blog heading.
&description;A summary of the entry, or the blog description.
&headTags;The description, canonical address and sharing tags, ready made. Use it in the page head.
&siteName;The site name from Settings.
&blogPath;The address of the blog page.
&blogTitle;The blog heading.
&publicationDate;Entry pages only. The date as 2026-11-24.
&publicationDateText;Entry pages only. The date as 24 November 2026.
ℑEntry pages only. The first picture in the entry, or nothing.
&imageAlt;Entry pages only. What the first picture shows.
&pageName;The address of the page.

Entry markup

<article class="blog-entry">
  <header class="blog-entry-header">
    <h1 class="blog-entry-title">Title</h1>
    <p class="blog-entry-meta"><time class="blog-entry-date" datetime="2026-11-24">24 November 2026</time></p>
  </header>
  <div class="blog-entry-content"> ... </div>
</article>

The content can hold h2 to h4, p, ul, ol, li, blockquote, a, img, figure, figcaption, hr, br, pre, code, strong, em, u, s, sup and sub. Nothing else is published, and none of them has a style of its own.

Blog page markup

<header class="blog-list-header">
  <h1 class="blog-list-heading">Blog</h1>
  <p class="blog-list-description">Description</p>
</header>
<ul class="blog-list">
  <li class="blog-list-item">
    <a class="blog-list-link" href="/Blog/the-entry">
      <img class="blog-list-image" src="/Blog/the-entry/picture.jpg" alt="">
      <span class="blog-list-text">
        <time class="blog-list-date" datetime="2026-11-24">24 November 2026</time>
        <strong class="blog-list-title">Title</strong>
        <span class="blog-list-summary">The first 200 characters</span>
      </span>
    </a>
  </li>
</ul>

An entry without a picture has the extra class blog-list-item--no-image. With no entries there is a paragraph with the class blog-list-empty.

An example entry template

<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>&title; | &siteName;</title>
&headTags;
<link rel="stylesheet" href="/Assets/site.css">
</head>
<body>
&insert:/OpenForum/PageTemplates/PublishedPage/header.html;
<main>
<p><a href="&blogPath;">&blogTitle;</a></p>
&content;
</main>
</body>
</html>

Things to avoid