[pmwiki-users] edit template for specific pages

Patrick R. Michaud pmichaud at pobox.com
Tue Mar 28 16:56:50 CST 2006


On Tue, Mar 28, 2006 at 04:36:23PM -0600, Tegan Dowling wrote:
>    On 3/17/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> 
>      On Fri, Mar 17, 2006 at 12:53:48PM -0600, Patrick R. Michaud wrote:
>      > On Fri, Mar 17, 2006 at 07:38:28PM +0100, noskule wrote:
>      > > hi list
>      > > How do I setup a rule that a pagetemplate  will be used if the
>      pagename
>      > > is "GroupConfiguration" ?
> 
>          $EditTemplatesFmt = 'Site.{$Name}Template';
> 
>      Yes, just one line!
> 
>    This is dynamite.  Then is this doable now, or would any wizard care to
>    concoct the code for:
> 
>    $EditTemplatesFmt = 'Site.*{$Name}Template';
>    So that I can create Site/FooTemplate, and then when, in any wikigroup,
>    someone creates pages AFoo, BFoo, and CFoo, the *Foo template is applied
>    to all three?

$pagename = ResolvePageName($pagename);
if (preg_match('/Foo$/', $pagename))  $EditTemplatesFmt = 'Site.FooTemplate';

Pm




More information about the pmwiki-users mailing list