[Pmwiki-users] RE: Page Edit Templates

chr@home.se chr
Wed Oct 6 11:49:05 CDT 2004


On Wed, 6 Oct 2004, Fred Chittenden wrote:

> The "wiki projectforum" has a "edit template" feature, if I understand you
> correctly.  When you start up a new page, you can pick a template to start
> editing.
...
> It's a very desirable feature, IMHO.  

I can think of several cases when it'd be useful to be able to choose a
template. I think this should be doable as a relatively simple extension.

Here's one way:

* Introduce an extra argument to the '?action=edit' parameter as follows
	?action=edit&template=SomeGroup.SomePage
  where the additional parameter causes the edit form to be set to the 
  source of the page 'SomeGroup.SomePage'. 

* Modify the edit page so that it contains e.g. extra buttons that link to 
  URIs such as these:
	http://.../<group>/<page>?action=edit&template=Main.Template1
	http://.../<group>/<page>?action=edit&template=Main.Template2
	http://.../<group>/<page>?action=edit&template=Main.Template3

When the user starts editing a new page, the edit form contains the
default text. The user now have the option to click on one of these
buttons, that will re-open the edit page, but with the edit form filled
with the source of the template page.

To me it seems that the only thing missing here is a smarter way to
generate the template buttons, so that users can add their own templates
to the list. That could be done in several ways, for instance by looking
for a list of pages first in the page <Group>.PageTemplates. And if that
page doesn't exist, look in Main.PageTemplates.

/Christian

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list