Loading...
 
Skip to main content

Features / Usability


Menu Subsections

posts: 3

Hi ... the effect I want to achieve is an abbreviated menu on the left side that only contains a few items specific to the current "area" of the wiki site (i.e. by category). I thought using categories would be the right way to achieve this.

So, I set up a user module for this BUT the user module does not appear to know what category the main page is (i.e. {$categorypath} and {$categoryobjects} are blank). So I can't do conditionals based on the category.

Am I doing something wrong or is there a smarter way to do this in 1.8.x?

THANK YOU!!!

-Glade

posts: 24

Hi Glade,

I don't work with categories so this might not work for you. First of all, if the main page is the only page that behaves different from the other pages, then simply do your conditionals on

if ($categorypath == '')
{
...
}

this is PHP, not sure in TikiWiki/Smarty.

Anyway, I bypass the Smarty engine wherever I can (I'm too lazy to get to grips with it and I know my PHP a lot better). If the category you are after is passed in the URL, then you can easily retrieve it with $_GET. Remember, PHP blocks go between (PHP} and {/PHP} tags. Between them you can put raw PHP.

Hope that helps a little.

Regards,
WillemB


posts: 3

Thanks for the answer Willem.

I haven't done a code review but I think the problem is that the "categorypath" isn't set when the rendering engine is emitting modules, only when it's emitting the actual page content (i.e. the middle row). So the variable is simply not there for me to test during execution of the module.

Perhaps there is some way to figure it out the category of the content using more PHP calls, I was just hoping I could test a variable.