[Pmwiki-users] SHTML-like templates for PmWiki

niall b durham nbd3355 at sci.tamucc.edu
Fri Dec 13 22:06:30 CST 2002

Hey guys,

For what its worth, I recently made a new local modification for
PmWiki.  I figured I would describe it on this list in case anyone
else was interested in it or had any comments.

The gist of it is that it is a SHTML-like template system for the
PmWiki pages.  Currently, it supports a default, group-specific, or
page-specific templates (just like pgcust.php) with the more specific
template overriding the less specific (if any).

The template files contain HTML and support a few simple directives.

The SHTML file inclusion directive:

    <!--#include file="foo.inc"-->

[It doesn't support the 'virtual=' argument, though.]

It has a means to substitute in the values of PmWiki variables (any 
global variable is fair game--I don't know whether or not this is a 
good idea, but that's the current implementation):

    <!--#pmwiki var='ScriptDir'-->
    <!--#pmwiki var='HTMLHeaderFmt'-->

The page is divided into the header/footer around the PmWiki page,
using the following tag:

    <!--#pmwiki body-->

This is (obviously) nothing that couldn't be done before.  I wrote
it because I was interested in a means to easily control all the 
surrounding layout/HTML of the PmWiki pages that did not require PHP 

Just in case it isn't apparent, the template files are not editable
via the PmWiki mechanism and are off in a separate directory (not

I figured I'd offer it back to the collective in case anyone is 

Any feedback (heh, even if its just to say this is a lame idea :) 
appeciated.  Especially w/ regard to syntax.  I'm uncertain about the 
variable substitution markup.  However, something less-explicit (e.g., 
'$ScriptDir') seems too open to mis-interpretation.



p.s. I'm going out of town tomorrow (Sat., 14th), so if I don't reply
promptly don't take it the wrong way.
nbd3355 at sci.tamucc.edu

More information about the pmwiki-users mailing list