[pmwiki] Re: [Pmwiki-users] Issues with WebMenu

Bernhard.Weichel@t-online.de Bernhard.Weichel
Fri Aug 15 00:57:36 CDT 2003


Patrick R. Michaud wrote:
> There are a couple of things you could do besides using the group.php
> files.  You could have local.php only include webmenu.php for certain
> groups, or you could check for the existence of the webmenu page and
> include it only if it exists.  Examples in local.php:
> 
>     $group = FmtPageName('$Group',$pagename);
>     if ($group != 'SomeGroup') include_once("local/webmenu.php");
> 
> will include webmenu.php only for pages not in SomeGroup.  Another
> possibility: 
> 
>     $webmenupage = FmtPageName('$Group.WebMenu',$pagename);
>     if (PageExists($webmenupage)) include_once("local/webmenu.php");
> 
> will include webmenu.php only if a WebMenu page exists within the
> group. 
> 
> Pm

My ideal is, if the WebMenu page doesn't exist for the gropu it falls back
to "Main/WebMenu". But it is very easy to control in webmenu.php:

$HandleBrowseFmt = array (
    "headers:",
    &$HTMLStartFmt,
    &$HTMLTitleFmt,
    &$HTMLBodyFmt,
    &$PageHeaderFmt,
    &$TextStartFmt,

    "wiki:\$Group.WebMenu Main.WebMenu",

    &$TextSplitFmt,
    "function:PrintText",
    &$TextEndFmt,
    &$PageFooterFmt,
    &$HTMLEndFmt
);

    "wiki:\$Group.WebMenu Main.WebMenu",     falls back to Main.Webmenu
    "wiki:\$Group.WebMenu Main.BlankMenu",   could display a blank page
    "wiki:\$Group.WebMenu",                  Allows to edit a new page

you can even have a combination

    "wiki:\$Group.WebMenu", "Main.StandardMenu"

which would combine multiple menu pages. Istn't that great?

Thanks Patrick for the page layou strategy in 0.5 ff.

--bernhard



More information about the pmwiki-users mailing list