Documentation Download as PDF

Templates Overview

When someone views any part of your Caribou website, the output that is sent to their browser (HTML, CSS stylesheets, JavaScript files, images, etc.) is 100% dependent on the templates system.

Modifying site designs quickly and efficiently is easily done by a Caribou Professional. Contact Caribou for a quote or for help with modifying the templates yourself.

An individual template looks like a standard HTML file but it also has programming markup in the Smarty scripting language. This programming markup is essential to Caribou as it allows for dynamic insertion of variables (such as "title", "body", "publish date", "comments", etc.). Furthermore, references within these templates can pull in data from other templates, template plugins (PHP files), and template functions (variable modifiers; ex. "strtupper" which would make a string of characters entirely uppercase). This documentation will not cover Smarty functions and features. Those are available at http://www.smarty.net. An example template may look like:

{include file="header.html" title="Test Page"}
<h1>{$title}</h1>
<div class="articlebody">{$body}</div>
{include file="footer.html"}

Templates are not individual pages for your website but rather files that dictate how many parts of your website will be displayed. For example, most themes (like the example code above) make use of a “header.html” file as well as a “footer.html” file to display content that wraps around all pages of your website. The header template may include such things as a logo, navigation, and a box for the page’s content. The footer template will close this box and likely include a footer with website links, contact information etc. Editing either the header or footer template will be reflected across the entire website automatically as most templates (such as “article.html”, “form.html”, and “store_product.html”) include both the header and footer.

A collection of templates is referred to as “thetemplate” or the “theme” of your website. Caribou comes with a few default themes to choose from but it is highly suggested that you modify a theme before releasing your website to make it your own.