Template Tags

Template tags are special placeholders in your page HTML files that RuntCMS replaces with dynamic content when a page is rendered. They use a {cms:...} syntax.

Template tags only work inside files in cms/pages/. They're processed by the RuntCMS template parser before the page is sent to the browser.

Full reference

TagOutput
{cms:page:title} The page title set in the admin panel
{cms:page:description} The page's meta description
{cms:page:slug} The page slug (URL path segment)
{cms:site:favicon} A complete <link rel="icon"> tag pointing to the site favicon
{cms:site:path} The site root URL (no trailing slash). Use for absolute paths to assets.
{cms:nav:pages} Generated navigation HTML — a list of published pages as anchor links
{cms:login_link} A login link shown to guests; hidden when logged in. Style it yourself.
{cms:year} The current 4-digit year, updated automatically at render time.
{cms:system:runtbar} Injects the editing toolbar and required scripts. Required on every page.
{cms:system:nonce} A CSP nonce value for inline scripts. Use if you write inline <script> tags.
{cms:partial:slug} Inserts a partial by its slug. Regions inside are automatically global.

Page tags

{cms:page:title}

Outputs the page's title as plain text. Use it in the <title> element and optionally in your <h1>:

<title>{cms:page:title} — My Site</title>
Page titles are managed in the admin panel (Admin → Pages). Editors cannot change page titles — only admins can.

{cms:page:description}

Outputs the meta description as plain text. Use it in the <meta name="description"> tag:

<meta name="description" content="{cms:page:description}">

{cms:page:slug}

Outputs the slug of the current page. Useful for adding a page-specific CSS class to the body or a wrapper:

<body class="page-{cms:page:slug}">

Site tags

{cms:site:favicon}

Outputs a complete <link> tag for the site favicon. Place it in <head>:

<head>
  {cms:site:favicon}
</head>

To set the favicon, upload a file named favicon.ico or favicon.png to your site root (public_html/). RuntCMS detects it automatically.

{cms:site:path}

Outputs the site root URL without a trailing slash — e.g. https://example.com. Use it whenever you need an absolute path to an asset:

<link rel="stylesheet" href="{cms:site:path}/cms/css/site.css">
<img src="{cms:site:path}/cms/uploads/logo.png" alt="Logo">

Using {cms:site:path} instead of hardcoding the domain means templates work correctly if you migrate to a different domain.

Generates a navigation list from published pages. See the full Navigation Tag documentation for the HTML output and CSS classes.

Outputs an <a> tag pointing to the login page. The link text is "Log in". When a user is already logged in, this tag outputs nothing — the link disappears.

A typical use is in the site footer copyright line:

<footer>
  <p>&copy; 2025 My Company {cms:login_link}</p>
</footer>

The link inherits whatever text colour is in effect. It has no button styling — it looks like a regular inline link. You can style it via CSS with the selector a.cms-login-link.

{cms:year}

Outputs the current 4-digit year at render time. Use it in copyright lines so the year updates automatically without touching any code:

<footer>
  <p>&copy; {cms:year} Acme Co</p>
</footer>

System tags

{cms:system:runtbar}

Injects the runtbar toolbar HTML and loads the runtbar JavaScript and CSS. This tag is required on every page template. Without it, logged-in users won't see the editing toolbar.

Place it just before the closing </body> tag:

  {cms:system:runtbar}
</body>

When a visitor is not logged in, this tag outputs nothing. There's no performance cost for regular visitors.

{cms:system:nonce}

Outputs the CSP nonce for the current request. RuntCMS uses Content Security Policy headers and generates a fresh nonce per request. If you have inline <script> tags in your template, add the nonce attribute to them:

<script nonce="{cms:system:nonce}">
  // your inline script
</script>

Without the nonce, inline scripts will be blocked by the CSP header and won't run for logged-in users.

{cms:partial:slug}

Inserts a partial (a reusable HTML snippet) by its slug. See Partials for full documentation.

{cms:partial:site-header}
{cms:partial:site-footer}

RuntCMS 0.9 Documentation