Congratulations, you have succefully installed FileCMS!

Creating content

Simply create .html files in the "content" folder. For example this page is called index.html and is shown as the landing page.

If you create a folder in the content folder (e.g. content/sub) and put an index.html inside it, you can access it at the URL If you want another page within the sub folder, create a .html file with the corresponding name (e.g. content/sub/page.html) and you will be able to access it from the URL Below are some examples of content location and their corresponding URL

Physical localtion URL
content/index.html /
content/sub.html /sub
content/sub/index.html /sub

If a file cannot be found, the file contents/404.html will be displayed. (It is mandatory to have contents/404.html!)

Every content file is expected to have a comment block with meta information at the top of the file. In this comment block any key-value pair can be specified. The following two are necesarry though:

Title: Always include the title!
Template: use_this_template

In content files, you can reference to the base URL and the images URL (specified in the configuration file) using %base_url% and %img_url%.


Widgets are special types of content in the sense that they are not a page. A widget is just a piece of content that can be located anywhere on the page. In the theme file you can specify where you want to display the widget. For example, the footer of this page is implemented as a widget. Widgets are located in "contents/widgets".


The configuration for your website can be found in config.php. In the configuration you should specify:

  • site_title: the main title for your website.
  • base_url: the URL to your website, without a trailing '/'.
  • theme: the name of your theme.

Main menu

The main menu is specified as an 'named array' where the name is the key is the title of your menu item and the value the URL. For example, the menu for the example website is specified as:

$menu = array(
    'Home' => '',
    'Page' => 'page',
    'Sub' => 'sub'

Note: No starting (or trailing) slashes are used. The URL that is specified is added to the base_url. If you want to link to an absolute URL, then start the URL with http://.


To create a theme make a folder that is named after your theme in the "theme" folder. You can select your theme by setting $config['theme'] in config.php.

Twig is used as the template engine. The variables below can be used in your theme:

  • {{ site_title }}
  • {{ base_url }}
  • {{ theme_url }}
  • {{ page }} (the current page)
    • {{ page.title }}
    • {{ page.uri }}
    • {{ page.url }}
    • {{ page.meta }} (any key-value pair you specify in the comment block at the top of a content page)
    • {{ page.content }}
  • {{ menu }} (see description below on how to use the menu)
  • {{ widgets }} (see description below on how to use widgets)

Main menu

The easiest way to create a menu is to do the following:

    {% for item in menu %}
    <li><a href="{{ item.url }}">{{ item.title }}</a></li>
    {% endfor %}


Reference to widgets using {{ widgets.widget-name }} where widget-name corresponds to the filename of the widget (without the .html).