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

2007-05-01 Thread The Editor
On 5/1/07, Patrick R. Michaud [EMAIL PROTECTED] 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

___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users


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

2007-05-01 Thread Hans
Tuesday, May 1, 2007, 2:51:47 PM, Patrick R. Michaud wrote:

 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.

First and foremost I would like to see an implementation of making
PTVs more general so we can use PTVs in page sections, as in

  {PageName#section$:Date}

and   (:include TemplatePage basepage=DataPage#section:)

Second to be able to use  {$$var} inside the included text.

Only last, but I need to think about this more, a (:sectionlist :)
directive.

Maybe the first two go hand in hand.
They would be incredible useful to build display templates for blogs
and forums and comment pages, of course for any display of data.
For this reason I wish an implementation would come rather sooner than
later. At least come together with the new form processing  you are
working on.

We have not added much in the cookbook in the direction of display
templates, and a core implemetation of data display via templates
would give PmWiki development a great boost and stop fragmented efforts
to do it via special markups etc.

  ~Hans


___
pmwiki-users mailing list
pmwiki-users@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users