9 Sep 2002 mglazer   » (Journeyer)

I finished work on a very simple and light modular templating and application tool.

Similar to my 4arrow.com/test/t/ template and macro tool this one adds a Virtual URI based engine and a corresponding structured template/macro containers.

A cache container which should duplicated the template one but doesn't have to.

The library directory contains the code that the templates reference in their structured pre-defined designs.

So the file distro looks like this:

.htaccess (mod_rewrite rules) index.php (interface) cfg.php (global configurations)

core/ (core scripts such as the template parser) library/ (PHP classes that are referenced within the templates) cache/ (container for parsed templates matched to URIs) template/ (container for pre-parsed templates matched to URIs)

Example template:

<xpc:date id="1" format="r" date="NOW" type="unix" />

<xpc:cache file="/test2.html" time="3600" path="cache/" type="encode">

<xpc:include file="templates/inc/header.html"/>

Date :<xpc:date id="2" format="r" date="NOW" type="unix" />
Uri: /test2.html

<xpc:include file="templates/inc/footer.html"/>

</xpc:cache>

The only to notice for now is when you reference two of the same tagnames use a id attribute that is unique for each.

You may also notice that you can cache individual blocks of nested pre-parsed tags.

Each template file can have a corresponding macro file which will automatically be slurped by using the naming convention like so: template: index.html template's macros: index_mcr.html

The template tags "xpc:name_here" are all based in teh 'library' folder and all follow a similar pre-defined structure.

I will move the demo distro to a web serving box for public display shortly.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!