|
Cookbook /
RemovingLeftContentSummary: Removing left or right part of the layout
Version:
Prerequisites:
Status:
Maintainer:
Categories: Obsolete
GoalRemoving left or right part of the layout, in the same manner as the (:nofooter:) and (:noheader:) directive (no sidebar, for example). Solution The (:noleft:) and (:noright:) directives are included by default in 2.0.beta44.
Create the directive (:noleft:) by writing in the config.php file :
Markup('noleft','directives','/\\(:noleft:\\)/e',
"PZZ(\$GLOBALS['PageLeftFmt']='')");
If you have set content in the right part of your layout that you wish to remove temporarily, you can create a (:noright:) directive as well :
Markup('noright','directives','/\\(:noright:\\)/e',
"PZZ(\$GLOBALS['PageRightFmt']='')");
From pmwiki2 beta22 onwards you can write instead:
Markup('noleft', 'directives',
'/\\(:noleft:\\)/e', "SetTmplDisplay('PageLeftFmt', 0)");
Markup('noright', 'directives',
'/\\(:noright:\\)/e', "SetTmplDisplay('PageRightFmt', 0)");
Markup('noheader', 'directives',
'/\\(:noheader:\\)/e', "SetTmplDisplay('PageHeaderFmt', 0)");
etc. Alternative SolutionFor pure css layouts which do not use a table in the page template for positioning of the left content and main content. Create the directive (:noleft:) by writing in the config.php file :
function NoLeftBar() {
global $HTMLStylesFmt, $PageLeftFmt;
$PageLeftFmt = '';
$HTMLStylesFmt[] = "#main { margin-left:0; }\n";
return '';
}
Markup('noleft','directives','/\\(:noleft:\\)/e', "NoLeftBar()");
DiscussionI did it in a different way - maybe for a different purpose: I removed all sidebar issues in the used marathon.tmpl file and modified the CSS slightly too. Maybe a bit too rude, but it works. I've my PmWiki running for less than a week and a month ago I even did not know what a Wiki is... My purpose is to use parts of my PmWiki installation as a CMS. Some WikiPages are running in a conventional HTML frame, where an additional sidebar would look stupid, because there is already a more sophisticated one for navigation on the left frame. For comfortable editing and navigation in my WikiPages, I just use the SkinChange way ?setskin=marathon, while for viewing in the frameset I use the same one (with another name: hsg) with removed sidebar code lines and modified CSS file. In case s.o. is just reading my homepage the pages are linked with ?setskin=hsg and I (administrator) use the default marathon skin. In case of interest I can add my URL here for demonstration. --Armin Is there a way to deactivate PageLeftFmt from within config.php? - Klonk What do you mean by "deactivate PageLeftFmt"? --Pm
Well I want to be able (or change my skin accordingly) to disable or hide the complete area that could be found within the PageLeftFmt section without editing the skin .tmpl file. - Klonk
If you do the same action as the markup, it should work --PRZ :
$PageLeftFmt = '';
$HTMLStylesFmt[] = "#main { margin-left:0; }\n";
global $BasicLayoutVars;
SDV($BasicLayoutVars,array('HeaderText','PageHeaderFmt',
'PageTitleFmt','PageText','PageRightFmt','PageFooterFmt'));
Q. Could you suggest an Alternative/Example for PageLeftFmt=? that can be inserted in config.php file. ~V Krishn Q. is it possible to make a link-(like button) 'hide/open the leftBar' in a page ? Thanks --Pierre79 ContributorsPm CSS version
|