[pmwiki-users] Templates for new pages

Nathan Jones pmwiki at optimo.com.au
Wed Mar 2 20:43:32 CST 2005


On Tue, Mar 01, 2005 at 04:07:59PM -1000, Sivakatirswami wrote:
>Is there a way to establish some template, with "blank" entries, 
>already marked up, such that if a user makes a new page the content of 
>the new page is automatically inserted in the main content <div>?

I assume you just want a simple template to guide the structure of your
content, rather than a complex set of selectable templates, as others
have discussed here.

Here is something I've used on a PmWiki v1 site (in config.php):

// If Group.Template exists, use it as a template for new pages:
if ($action=='edit' &&
PageExists(FmtPageName('$Group.Template',$pagename))) {
  $page = ReadPage(FmtPageName('$Group.Template',$pagename));
  $DefaultPageTextFmt = $page['text'];
}

..but I don't know if it works with PmWiki v2. Perhaps someone who is
more familiar with PmWiki variables and code could tell me whether this
needs an update for v2.

The good thing about this approach is that it is simple (just create a
new page and your basic outline is there), plus you can haven't different
templates for different groups. For example, no template for Main, but
use a template for a ClassOutlines group.

>I am a wiki newbie.. and a little insecure, not about having people be 
>able to edit things, but about the form it takes over time...

If you tell people to stick to the template, they probably will, unless
your templates are inflexible (in which case you revise them). The form
may change over time, but if you guide it (through templates and
arranging content), people will tend to follow, rather than do anything
that takes extra effort.

-- 
Nathan Jones



More information about the pmwiki-users mailing list