Contemplate™ Web Templating System  


Latest release

Contemplate 2.0.2
16 Nov 2011
download now!

Content files

After setting up your templates, creating content files is relatively easy. The most common type of content file is simply an HTML file that contains one large table:

##home This is the home page content. It can contain pictures, multimedia objects, and any kind of HTML formatting you can think of.
##contact_us This is the contact us page content. Ditto.
##site_map This is the site map page content. Ditto.
##home_sidebar This is content that we'll put in the sidebar of the home page. We've placed it in a separate field from the other home page content so that we can rearrange their positions on the page without editing this file.

The only rules for content files are that you lay out your fields in table cells as shown here, that each field name begin with the field marker, and that each field have a unique, alphanumeric name. Beyond that, you can name and organize your content fields and files in whatever way works best for you. The default field marker is "##," but you can use a different field marker by specifying any string in the config/constants.php file.

If you prefer, you can delineate your content fields using XML tags rather than an HTML table:


<group name="thoreau">

<content name="drummer">
If a man does not keep pace with his companions,
perhaps it is because he hears a different drummer.

<content name="dreams">
I learned this, at least, by my experiment: that if one advances
confidently in the direction of his dreams, and endeavors to live the
life which he has imagined, he will meet with a success unexpected in
common hours. </content>



If you then give your content file and .xml extension, Contemplate will process it accordingly. The group tags are optional, but if you use them you can nest them to as many levels as you want to organize your content. In this case, your page definitions would refer to content using slashes between the levels, as in this example: quote=field,quotes.xml,thoreau/drummer.

Finally, you can save your content in .txt or other plain-text formats. However, you will only be able to embed the entire file into your templates, since Contemplate won't know how to find smaller pieces of content within the files.

Contemplate is developed by Arlo Leach.