[pmwiki-users] Different Templates for $Group

Patrick R. Michaud pmichaud at pobox.com
Mon Mar 14 11:13:45 CST 2005


On Thu, Mar 10, 2005 at 05:13:27PM -0500, Tom Holroyd wrote:
> >            I need different configurations for my different Groups 
> >?newpages?.
> 
> The trick that I am using is as follows:
> 
> I want users to be able to add items to a list, and then have 
> different templates for different lists.  Everything is in one group.
> So, let's say we are in a group called "Grp".  There's a page called 
> "Grp/TheItems" containing a bullet list of items.
> Create local/Grp.php, containing:
> [...]
> Now, a user edits the bullet list in Grp/TheItems, and adds a new 
> item.  The new page's edit link, when clicked, will automatically load 
> the template appropriate for that list.

Oh, that is totally cool, and so obvious.  

And seeing this has indirectly shown me an extensible way to provide a
list of templates in an edit page.  Rather than worry about mucking with
$PageEditFmt and its HTML things, we really should put a lot of this 
stuff in the wiki itself.  For example, one can generate a list
of editing-via-template items by using markup such as:

    * [[{$FullName}?action=edit&template=Group/SomeTemplate1]]
    * [[{$FullName}?action=edit&template=Group/SomeTemplate2]]
    * [[{$FullName}?action=edit&template=Group/SomeTemplate3]]

(The markup and display output could be much cleaner than what the
above will produce, but I'm keeping it simple for illustration.)

So, if we can just get this bullet list into the edit page output
somewhere, an author confronted with a blank edit page would be able
to choose to re-edit the page via SomeTemplate1, SomeTemplate2, etc.
And we already have a way to generate markup in the Edit Page
template -- this is exactly what the EditQuickReference page does.

So, perhaps we just need a way to include a variety of wiki content
pages at the top and bottom of the edit pages, and have custom markups
for the different features that need to appear on the edit page.
The layout would be very customizable at that point.

Or perhaps the edit page (and attribute pages and other special pages,
and comment boxes, and...) just become specialized markup.

I'll have to think about this a fair bit, but it does nudge things
along a fair bit.  Thanks for the excellent idea.

Pm



More information about the pmwiki-users mailing list