[pmwiki-users] (:sectionlist:) proposal (was: New template expression markup....)

The Editor editor at fast.st
Tue May 1 09:30:22 CDT 2007


On 5/1/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> Continuing on the brainstorming track, we could develop a
> (:sectionlist:) markup that does for sections the same thing
> that (:pagelist:) does for pages.  In particular, (:sectionlist:)
> would read a page's markup, split it into sections by anchor, and
> then apply a template to each section.  For example:
>
>    (:sectionlist fmt=Site.BlogTemplate:)
>
>    [[#id0001]]
>    (:author:Pm:)
>    (:date:2007-05-01:)
>    (:subject:demonstration of sectionlist:)
>    (:text:...:)
>
>    [[#id0002]]
>    (:author:Alice:)
>    (:date:2007-05-01:)
>    (:subject:what a cool idea:)
>    (:text:...:)
>
> Or, to view the sections from another page:
>
>    (:sectionlist OtherPage fmt=Site.BlogTemplate:)
>
> Of course, one could use (:sectionlist:) inside of a pagelist
> template to apply templates to sections across multiple pages:
>
>    [[#sectionlist]]
>    (:sectionlist {=$FullName} fmt=Site.BlogTemplate:)
>    [[#sectionlistend]]
>
> Note that I make no representations as to how fast or slow this
> is likely to be, nor am I committing to any implementation or timeline
> for such.  At this stage I'm just suggesting a direction for discussion,
> and indicating the direction I'm likely to head for this.


I just put together a solution for my needs, mentioned in the other
post--by using a markup expression.  Basically:

1) Use ZAP/Fox to create a page long these lines:

[[#ID1]]
name: Caveman
time: Today
comment: Welcome to the new section template system...

[[#ID2]]
name: Coyote
time: Tomorrow
comment: Guess he's gonna get deprecated...

[[#ID3]]
name: Editor
time: Soon
comment: One of these days I'll do my own website done!

2) Second, create a template as normal (with {$$field} syntax).

3) On the page you want to show the display put this markup:

{(section datapage templatepage)}

The rest is automatic.  I'll be adding it to the ZAPtoolbox and
MarkupExpressionsExtension list shortly as I believe it will prove
very useful.

I've just been testing it out and it's very cool.  Very easy to put
links to editing the template or data for an admin.  And with ZAP's
edit command you can retrieve one specific section and edit it
directly (the data fields), or insert a delete link to each comment.
Exactly what I was looking for.

It could of course be renamed sectionlist (which is better), and/or
changed to a directive--but this is my current implementation.

Cheers,
Dan


Cheers,
Dan



More information about the pmwiki-users mailing list