[pmwiki-users] Different template for individual pages?

H. Fox haganfox at users.sourceforge.net
Fri Feb 10 15:58:23 CST 2006


On 2/10/06, H. Fox <haganfox at users.sourceforge.net> wrote:
> On 2/10/06, Kurt Devlin <kurt.devlin at gmail.com> wrote:
> >
> > On 2/10/06, Brian Connolly <bconnolly at furthermore.com> wrote:
> > > No page at the link you sent.  However, I Googled it and got a rough idea.
> >
> > Pm left off the trailing 's' in the link. It should be
> > http://www.pmwiki.org/wiki/PmWiki/PerGroupCustomizations
> >
> >  I added a redirect page at the page Pm listed, but I wasn't quick enough
> > :-)
> >
> >
> > > So... if I wanted the change the skin on the page Main/KeyIssues,
> > >
> > > Put a file in /local called KeyIssues.php.  And in it have say...
> > >
> > >    <?php
> > > $Skin = 'red1';
> > >     ?>
> > >
> > > And modify the skin accordingly.
> > >
> > > Yes?
> > >
> >
> > You got it mostly. To override a specific page, it need to be fully
> > qualified, so you'll need a file called Main.KeyIssues.php. Also, it is
> > usually recommended to leave off the closing "?>" in the PHP.
>
> In pmwiki-2.1.beta21 or newer you can do, in config.php,
>
>     $pagename = ResolvePageName($pagename);
>     if ($pagename = 'SomeGroup.SomePage') {
>       SDV($Skin, 'red1');
>     } else { SDV($Skin, 'blue1'); }

Correction: "="  should have been "==".

    $pagename = ResolvePageName($pagename);
    if ($pagename == 'SomeGroup.SomePage') {
      SDV($Skin, 'red1');
    } else { SDV($Skin, 'blue1'); }

Hagan




More information about the pmwiki-users mailing list