[pmwiki-users] Edit Template for a group

Dr Fred C drfredc at verizon.net
Sun Mar 11 12:02:20 CDT 2007


Thanks for everyone's help. 

IMHO, the problem still remains that the PMwiki solution to the Edit 
Template issue is not wiki like at all, rather it's a programming kludge 
shoe horned into the local config file.  I guess I expect more of a 
NotifyList like wiki solution out of PMWiki.  Perhaps it would be 
helpful if the default local/config came predefined with 
"$EditTemplatesFmt = '$Group.Template'; ".  Then presumably one could 
just proceed to create Template files for every group without php 
definition hassles.  With this list's help, at least I can proceed 
beyond this now. 

Tegan Dowling wrote:
> On 3/10/07, Dr Fred C <drfredc at verizon.net> wrote:
>> OK, maybe I just can't read the nose in front of my face.  But I can't
>> seem to make any sense of how to make Edit Templates do anything but
>> provide a site wide template.  What I need is a template for a specific
>> group called "Roster".
>
> On PmWiki/EditVariables, it says
>
> $EditTemplatesFmt
>    Name of the page (or an array of names) to be used as the default
> text for any newly created pages.
>
>        # Use 'Main.NewPageTemplate' as default text of all new pages
>        $EditTemplatesFmt = 'Main.NewPageTemplate';
>
>        # Use 'Template' in the current group for new pages
>        $EditTemplatesFmt = '$Group.Template';
>
>        # Use 'Template' in the current group if it exists, otherwise
>        # use 'Main.NewPageTemplate'
>        $EditTemplatesFmt = array('$Group.Template', 
> 'Main.NewPageTemplate');
>
> The second of these three looks like the one you want.  In
> Local/config.php, place
>        $EditTemplatesFmt = '$Group.Template';
> And create a page in the Roster group named Template, i.e., create
> Roster.Template.  Thereafter, new pages in the Roster group will
> automatically contain the Template's contents when created.
>
>
> Note, for more complex rules: I use
>       # EditTemplates variable -
> http://www.pmwiki.org/wiki/Cookbook/EditTemplates
>       # use 'Template' in the current group if it exists,
>       # otherwise use 'Templates.{$Name}Template'
>
>       $EditTemplatesFmt =
> array('{$Group}.Template','Templates.{$Name}Template');
>
> (While the first part of this enables the exact situation you're
> requesting, the second part of this has allowed me to create a
> Templates group containing pages SideBarTemplate, GroupHeaderTemplate,
> etc, which prepopulate SideBar and GroupHeader pages whenever they're
> created in any group.)
>
>

-- 

Always, Dr Fred C
drfredc at drfredc.com




More information about the pmwiki-users mailing list