[Pmwiki-users] Removing sidebar if there's no SideBar-page

Patrick R. Michaud pmichaud
Sun Feb 15 08:58:40 CST 2004


> Unfortunately the above doesn't work in the sense that setting
> 	$PageLayoutFmt['wikileft']=''
> doesn't help, the layout still has a big empty space to the left :-(
> What's wrong?

If you're using the css-based layout ($EnableStdLayoutTable==0), 
then the css definitions still have a margin-left on the div#wikibody 
cell (this is what makes room for the sidebar in the first place).  

This isn't a problem in the table-based center layout 
($EnableStdLayoutTable==1), where it simply omits the table 
cell and everything "works".

If you're wanting to use CSS and have the sidebar(s) be optional, 
my suggestion is to create an alternate stylesheet/skin that doesn't
have the left bar and then do:

   $PageLayoutFmt['wikileft'] = '';
   $PageSkin = '<name of your alternate skin>';

> It uses a modified version of PageExists() which I think should replace
> the current PageExists().

--> A "heads up" warning:  $WikiDir and $WikiLibDirs are likely to change
meanings slightly in an upcoming minor release, to be able to support
group subdirectories in wiki.d/ .  Shouldn't affect any installations but
it's worth noting. <--

As far as the MyPageExists function--is the problem that it's
not possible to delete/detect Main.SideBar because it exists in the 
wikilib.d/ distribution?  I hadn't considered that problem.  One relatively 
easy solution is to choose a different name for the sidebar page altogether:

   $PageLayoutFmt['wikileft'] = 'wiki:$Group.LeftBar Main.LeftBar';

Another possibility is to make the PageLayoutFmt variables smart enough
to detect the existence of included pages before generating the cell,
so that the above would automatically not generate the wikileft block
if neither $Group.LeftBar nor Main.LeftBar pages exist.

Pm



More information about the pmwiki-users mailing list