Snippy Template

 

This is an ultra-ultra-minimal system for quickly adding a look and feel to a small site. The intent is that your preppy pages will want to have a consistent header and footer, like the unimaginative blue ones on this page.

{{doHeader(title="Why you should give us your money")}}

Your fancy content here

{{doFooter()}}

We have often found that we are given templates by designers using Dreamweaver or other tools. It's useful if the template can be "pure HTML" and not preppy or some similar system. So, we allow very simple substitutions. First, make youre template page. Assign its filename to the pageTemplate property of a webapp. Embed in it two special comments:

    <!--user content starts here-->, 
and
    <!--user content ends here-->

Anything before the first content becomes part of the header, and anything after the second is part of the footer.

Next, you may put in snips. These are substitution zones. To make the title a replaceable section, you can make a 'title' snip. This is two comments, with your dummy content between them:

    <!--titlesnip-->My Page Title<!--titlesnip-->

If you call doHeader or doFooter with a keyword argument 'title', the comments and anything between them will be replaced with the parameter value.

While less powerful than preppy, this is a generalisation of a pattern that has served us well for keeping a consistent look and substituting titles, meta-tags, menu blocks etc. If oyu want something more than this, use the include function and prep files.

 

Powered by ReportLab