[Pmwiki-users] Templates and variables: a thought

Patrick R. Michaud pmichaud
Thu Feb 26 18:48:28 CST 2004


On Fri, Feb 27, 2004 at 12:03:32PM +1100, Nathan Jones wrote:
> Pm wrote:
> >What should we use as an ending markup?  Or, another way to think of the
> >"ending" markup is that it is something that marks the beginning of
> >an "anonymous" section--a section not associated with a particular
> >variable, name, or feature.
> 
> <!--EndFmtVariable--> (first preference)
> <!--EndSection--> (second preference)
> 
> I can't think of anything clear enough to signal the start of the
> anonymous block that follows the variable. Maybe <!--FreeText-->, but I'm
> not very fond of that.

Hmm, I like <!--EndSection--> the best of these.

> A couple of questions, while I'm here:
> 
> 1. Does PmWiki support a particular list of variables (such that
> <!--PageYaJiFmt--> is just a comment), or does it place anything matching
> /Page.*Fmt/ into a variable?

At present it matches anything matching Page.*Fmt into a variable.  The
first implementation I put together restricted it to a list of particular
variables, but shortly thereafter I added PageEditFmt and PageUploadFmt
to the list, and as I started to add PageSearchFmt, PageAttrFmt, PageDiffFmt,
etc. to the restricted list I realized that this was a useful generic 
mechanism for loading the output format variables that other script authors 
might want to take advantage of.  So the pattern is actually 
/Page[A-Za-z]+Fmt/.  

It is possible to do some undesirable things because of this--PageStartFmt,
PageEndFmt, and PageFileFmt should never be set via the template--but I 
think things will break pretty dramatically/obviously if someone ever
tries to do this.

There is a restricted list of sections that actually make it into a 
page's generic template:  they are PageHeaderFmt, PageTitleFmt,
PageLeftFmt, PageRightFmt, and PageFooterFmt.  Any section that isn't
one of these names doesn't make it in to the "generic" output but has
to be explicitly requested by an action (e.g., PageEditFmt or PageUploadFmt).

The PageLeftFmt and PageRightFmt sections will likely be controlled by a 
[[nosidebar]] directive, to be implemented at some point in the future.

> 2. PmWiki.LayoutBasics just says <!--HeaderText--> is a required
> directive - what generally goes into this section? [Goes and looks at
> HTML output] Never mind - meta stuff - will add to PmWiki.LayoutBasics
> later.

Okay, or feel free to create a PmWiki.LayoutIntermediate or 
PmWiki.LayoutAdvanced page.  I think that LayoutBasics should give
just the basics needed to modify/create a new skin, while another page
can provide the details relating things to variables, [[noheader]], 
[[nofooter]], etc.

Pm



More information about the pmwiki-users mailing list