[Pmwiki-users] printable-page, flexlayout, and webmenu

Carlo Strozzi carlos
Tue Aug 19 08:55:35 CDT 2003


On Tue, Aug 19, 2003 at 10:19:11AM +1200, John Rankin wrote:
> As Carlo, says, use conditional includes.
> 
> Try
> 
>   if($action=="browse")include_once("local/webmenu.php");
> 
> Make sure
> 
>   include_once("local/printable-page.php");
> 
> comes *after* the test, because printable-page resets the action from print to browse...
> 
> So the page is only formatted with a web menu in browse mode.

Yup. To be more precise, here's the relevant section from a Group.php of mine,
where the "-it" suffix stands for "italian":

---------------------------- snip ---------------------------------------
### BEGIN grop-specific customization; this section must come last.
## See http://www.pmichaud.com/wiki/PmWiki/PerGroupCustomizations

## Include various (localized) add-on packages.

# Conditional inclusion of flexlayout.php
# See http://www.pmichaud.com/wiki/Cookbook/FlexLayout
# The local.css file should be customized as desired.
#
# The per-group customization file is taken into account last, so the
# following test is necessary not to override what was set in the
# printable-page-it.php section below.

if ($action != "print") {
   include_once('local/flexlayout-it.php');

   # WebMenu (this has to do with flexlayout, but I haven't
   # tested it yet).
   # See http://www.pmichaud.com/wiki/Cookbook/WebMenu
   #include_once("local/webmenu.php");
}

# edit preview. It *must* be included after flexlayout.php.
# This does not currently use the proper stylesheet set by
# flexlayout; this ought to be be fixed eventually.
#
# See http://www.pmichaud.com/wiki/Cookbook/EditPreview

if ($action == "edit" || isset($HTTP_POST_VARS['myaction']))
                                include_once("local/preview-it.php");

# Improved printable-page.php. Note that if this one is used, it *must*
# be included last (see the code for explanations).

if ($action == "browse" || $action == "print" || !isset($action))
			include_once("local/printable-page-it.php");

### END grop-specific customization.
---------------------------- snip ---------------------------------------


Carlo
-- 
For best reading please set the Courier font.
Freedom for Business: http://swpat.ffii.org



More information about the pmwiki-users mailing list