[pmwiki-users] Use separate skin for page
pbowers at pobox.com
Mon Mar 26 05:46:01 CDT 2012
On Mon, Mar 26, 2012 at 11:37 AM, <publik at lundgren.nu> wrote:
> I want/need to use a separate skin for some (a few) pages on my site.
> I think I have found out a couple of ways to do this but none of them
> "feels right".
> Does anyone "know" the "right" way (AKA "best") to do this in PmWiki?
If it's limited to 3-4 pages or groups then simply a per-page or
per-group customization file would be the preferred. If there are
more than that then it would probably be better in a simple
conditional in your config.php:
$pagename = ResolvePageName($pagename);
if (in_array($pagename, array('GroupA.PageA', 'GroupB.PageB', [...])))
$Skin = 'myskin';
$Skin = 'otherskin';
Be aware that ResolvePageName() implicitly calls some functions which
do caching, so this should be late in your config.php. Obviously
there are other ways to do the conditional besides in_array
(preg_match with an array of REs comes to mind if they fit patterns)
but presumably you've already got that figured out...
More information about the pmwiki-users