Loading...
 
Skip to main content

Features / Usability


You are viewing a reply to Conditional menus? Module syntax info?

Re: Re: Re: Conditional menus? Module syntax info?

OK, it works. I included the following in the code of the custom module:

Copy to clipboard
{php} if (preg_match("/tiki-index/i",$_SERVER['REQUEST_URI'])) { {/php} {menu id=4} {php} } else { {/php} {menu id=2} {php} } {/php}


Of course, the 'if' may test a lot of various things, but since I needed to distinguish between wiki and the rest of the site, I used a simple regexp on the URI. This means that on wiki admin pages I'll stil get the main menu, but the regexp can be extended if needed, or replaced with any other test. The 'slist' command in the debug console lists a lot of available variables.

Thanks to damian and first of all to sylvieg for help 😀

--
GStaniak, gs...@wp...