[Pmwiki-users] Re: Re: Setting Sidebar to ThisGroup:SideBar

Patrick R. Michaud pmichaud
Thu Feb 12 14:54:29 CST 2004


On Fri, Feb 13, 2004 at 08:26:52AM +1100, Elindal wrote:
> A variable to ask if the sidebar should be left or right. [Default left]

I try not to create too many special-purpose "flag" variables/values 
as it just makes the code longer to process the special values.
But there are relatively easy ways to achieve what you want...read on.

> [...]  The default should be that it looks for '$Group.SideBar'.
> There should then be a variable to chose if a Generic SideBar should be
> used instead. [Default on]  This is so someone can have a Generic 
> Sidebar for most of the Groups on their Wiki, but Administratively 
> turn it off if they want to for a Group.

I can (and probably will) make the default setting as follows:

   $PageLayoutFmt['wikileft'] = 'wiki:$Group.SideBar $DefaultGroup.SideBar';

Someone who wants to move the bar to the right simply does:

   $PageLayoutFmt['wikileft'] = '';
   $PageLayoutFmt['wikiright'] = 'wiki:$Group.SideBar $DefaultGroup.SideBar';

Someone who wants to turn the sidebar off in a Group.php file simply does:

   $PageLayoutFmt['wikileft'] = '';    (or 'wikiright')
`
> The only thing it does not cater for is someone who wants a
> SideBar on both sides of the page. But that would be rare I would expect.

But someone who wants a sidebar on both sides of the page can do:

   $PageLayoutFmt['wikileft'] = 'wiki:$Group.SideBar $DefaultGroup.SideBar';
   $PageLayoutFmt['wikiright'] = 'wiki:$Group.SideBarRight';

All of these can go into Group.php or Group.Page.php files to limit
the effect to a group or page.  Modifying these variables directly
(instead of providing special "sidebar page name", "sidebar left/right",
and "maingroup on/off" variables) allows for even greater flexibility,
as one can actually choose pages with differing page names, display
multiple pages in a sidebar, etc.

Pm



More information about the pmwiki-users mailing list