[pmwiki-users] New template expression markup....

Patrick R. Michaud pmichaud at pobox.com
Tue May 1 07:23:16 CDT 2007


On Tue, May 01, 2007 at 09:45:44AM +0100, Hans wrote:
> Tuesday, May 1, 2007, 1:42:07 AM, The Editor wrote:
> > [...]
> > (:template <datapage> <templatepage>:)
> 
> > It opens the datapage, explodes the content by the anchors, inserts
> > the data values into the template, and then re-implodes the output and
> > sends it back to the page.  

It might also be worthwhile to generalize PTVs to work with
sections.  For example:

    {PageName#section$:Date}

would grab the $:Date PTV out of PageName#section.  Then applying
a template to a single section simply becomes a variation of

    (:include <templatepage> basepage=<datapage>:)

except that <datapage> here would be allowed to contain a section
identifier.

> http://www.pmwiki.org/wiki/Cookbook/FeralFormattedEntry
> which provides a kind of data container markup, and uses a template
> for formatted display of its data content. Data is stored as parameter
> values inside the markup, for instance
> 
> (:ffe heading="A new entry" author="Jim" template=Site.BlogTemplate:)
> Some text
> from a textarea input box.
> (:ffeend:)

FWIW, I've been thinking that parameters to include should be
usable as {$$var} inside the included text, so that the above
could be something like

  (:include Site.BlogTemplate heading="A new entry" author="Jim":)

and we'd just need a convenient way to get multi-line text
values into something that could be used by a template.  

> (:ffe template=Site.BlogTemplate:)
> (:heading:A new entry:)
> (:author:Jim:)
> (:text:
> Some text
> from a textarea input box.
> (:ffeend:)
> 
> (:ffe template=Site.BlogTemplate:)
> (:heading:reply to you:)
> (:author:John:)
> (:text:
> What is all this about?
> more text lines...
> (:ffeend:)

Perhaps instead:

  (:include Site.BlogTemplate 
            heading="new entry" author="Jim" text=$:comment1 :)
  (:comment1:
  Some text
  from a textarea input box.
  :)

  (:include Site.BlogTemplate
            heading="reply to you" author="John" text=$:comment2 :)
  (:comment2:
  What is all this about?
  more text lines...
  :)

Inside of Site.BlogTemplate, {$$text} would be replaced
with the value of the "text=" argument above, which would
result in either {*$:comment1} or {*:comment2} and grab
the appropriate PTV.

Just some rambling thoughts.  FWIW, it is _very_ likely that 
(:include:) will end up processing {$$...} variables from the 
arguments to the include directive.

Pm



More information about the pmwiki-users mailing list