[pmwiki-users] Templates for new pages

Patrick R. Michaud pmichaud at pobox.com
Sat Mar 5 13:07:25 CST 2005


On Wed, Mar 02, 2005 at 12:27:56PM -0500, Tom Holroyd wrote:
> 
> Could you set $DefaultPageTextFmt in Group.php for a particular group 
> to contain the template?  Then if the page doesn't exist you 
> automatically start editing an empty template.

http://www.pmwiki.org/wiki/Cookbook/EditTemplates allows someone
to do this site-wide with:

    include_once('cookbook/edittemplates.php');
    $EditTemplates = '$Group.Template';

> Or you could define an ?action=template=name that would load template 
> name for a group and start editing it.

It's not currently mentioned on the cookbook page (I couldn't figure out
a good way to describe/document it), but the script also allows:

    .../pmwiki.php/Main/SomeNewPage?action=edit&template=Main.SomeTemplate

which says to use Main.SomeTemplate as the text for SomeNewPage
if it doesn't already exist.  This is to make it easier to eventually
offer a drop-down list of templates for new pages (but I still have
to figure out how to do *that* in an extensible manner :-).

Pm



More information about the pmwiki-users mailing list