[pmwiki-devel] FmtTemplateVars function

Hans design5 at softflow.co.uk
Tue Feb 10 12:58:06 CST 2009


Tuesday, February 10, 2009, 6:11:39 PM, Patrick wrote:

> Could I see some actual examples of how you intend to
> be using (:include:) in this case?  I suspect that PmWiki
> already provides capabilities to do whatever you're wanting
> to do (or can be easily extended to do so) without having
> to modify existing markup definitions.

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.

I suppose for you the function does exacly what it should: replacing
page variables with their values, and 'escaping'  their evaluation in
the template. The replacements on other variables with {$$var} syntax
is just a secondary thing. And PTVs should be evaluated through
PageTextVars.

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.

Thanks,
Hans




More information about the pmwiki-devel mailing list