Next: ttree output when running Previous: Pre Process example Contents: Index |
Assuming you've created or copied the 'header' and 'footer' files from the earlier example into your 'lib' directory, you can now start to create web pages like the following in your 'src' directory and process them with ttree.
$src/newpage.html:
[% INCLUDE header title = 'Another Template Toolkit Test Page' %] <a href="[% home %]">Home</a> <a href="mailto:[% email %]">Email</a> [% IF graphics %] <img src="[% images %]/logo.gif" align=right width=60 height=40> [% END %] [% INCLUDE footer %] Here we've shown how pre-defined variables can be used as flags to enable certain feature (e.g. 'graphics') and to specify common items such as an email address and URLs for the home page, images directory and so on. This approach allows you to define these values once so that they're consistent across all pages and can easily be changed to new values. |