The demo

This is the October CMS demo theme that explores the core features. You will find files used by this theme in the themes/demo directory of your installation.

This page demonstrates the basic CMS features. Usually each page built with October is a combination of a layout, page, partials and content blocks, although in simple cases you can just use a page without anything else.

Layouts

  Layouts define the page scaffold.

The layout file layouts/default.htm defines the page scaffold — everything that repeats on each page, such as the HTML, HEAD and BODY tags, StyleSheet and JavaScript references.

The page menu and footer in the Demo theme are defined in the layout as well.


Pages

  Pages hold the content for each URL.

The page file pages/home.htm defines the page URL (/ for this page) and the page content. Pages are rendered inside layouts with this function that should be called in the layout code:

{% page %}

Using a layout for pages is optional — you can define everything right in the page file.


Partials

  Partials contain reusable chunks of HTML markup.

Partials are chunks of HTML defined in separate files that can be included anywhere. Partials are rendered with:

{% partial "partial-name" %}

You may place partials inside folders too. In this example we placed the footer content to the partials/site/footer.htm partial.

{% partial "site/footer" %}

Partials can be used inside pages, layouts or other partials.


Content blocks

  Content blocks are text or HTML blocks that can be edited separately from the page or layout.

The introductory text used on this page is defined in the content/welcome.htm file. Content blocks are defined and rendered with:

{% content "content-name.htm" %}


Placeholders

  Placeholders allow pages to inject content to a layout.

The common use is injecting page-specific links to StyleSheet or JavaScript files to the HEAD tag defined in the layout. Placeholders are defined in the layout file and they have names so that they can be referred in the page. Example:

Layout file:

<head>
    ...
    {% placeholder head %}
</head>

Page file:

{% put head %}
    <link href="css/theme.css" rel="stylesheet">
    <script src="js/script.js"></script>
{% endput %}

Assets

  Assets are resource files like images and stylesheets.

This theme stores its asset files (JavaScript, StyleSheet, images, fonts, etc) in the themes/demo/assets directory. This theme is also packaged with these useful 3rd party tools:

You might prefer to remove them for your website implementation.


});