Includes

Includes are snippets of code that can be re-used. Most commonly they are used as header and footer for templates so that this common code (e.g. the Doctype and copyright information) doesn't need to be duplicated in every single template that you create. Another advantage is if you want to make a change across hundreds of pages, you only need to edit that one Include, providing it is referenced in the template that is shared across those pages.

To make an Include, select Includes from the Templates menu in the administration dashboard, click Add Include, enter a reference for the include (e.g. my-header), then enter the markup for the include.

Then, you simply reference that Include from your template: for example, . The markup you used in the Include will be produced within the template, and therefore in your pages, too. Includes can also be used in blocks.

Includes can be included within other includes, which makes the templating engine very powerful and useful for large sites that utilize lots of re-used code.