[pmwiki-devel] FmtTemplateVars function

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 10 13:32:12 CST 2009


On Tue, Feb 10, 2009 at 06:58:06PM +0000, Hans wrote:
> I do not want to use (:include:) ;-)
> If I do use (:include:) to include a template, in which replacement
> variables then get filled  with various values, I can avoid the
> naming conflict by choosing different key words.
> 
> I am working on a recipe, in which PTVs get picked up from various
> places, then assembled into an array of 'items', each containing a
> set of PTVs. I would like to use the FmtTemplateVars function,
> because it is there and promises to replace in a text provided any
> var suppllied in an array with its value.
> 
> This is all straight forward and logical. But FmtTemplateVars is doing
> more: it first does page variable replacements if it finds a matching
> {{$var} in the text. To avoid that, I cannot use any {$$var} with
> a name which is a PV in such a display template.

My point remains:  If your items contain a set of PTVs or are
fundamentally based on PTVs, then perhaps the substitution markup
should have a colon in it somewhere.  That's how PmWiki consistently
distinguishes {$Name} from {$:Name}.

> Since I primarily want to substitute variables which are read as PTVs I
> will not try to use FmtTemplateVars but use my own function. Fair
> enough.

We can also update FmtTemplateVars to do things based on PTVs --
i.e., {$$:Name}  would be an immediate template substitution of
the 'Name' PTV for a page.

Pm



More information about the pmwiki-devel mailing list