Loading...
 
Skip to main content

Features / Usability


tikiwiki.org menus . How do you do it


For the tikiwiki document pages there are 2 levels of menus.
The very top horizontal menu line remains the same always and the lower horizontal menu line changes depending upon the top menu selection.
I guess that this is done by using categories?

This is a great feature and I would like to use it.

Can someone post how this is implemented?

Thanks in advance

If I understand your question correctly, the Tiki sites use the "secondary site menu" (new feature in Tiki 5) for the menu at the very top of the page, which is configured on the Look and Feel admin pages.

The links are to the different Tiki sites (which are hosted at more than one server but have the same visual theme but with color-variant theme options).

The main horizontal menus are set on the Admin Menus pages of the several sites.

(If this seems like all one site to you, that's good because that is actually the intended effect.)

To have this context-sensitive menu changing at a single site, you'd have to use the custom menu text area on the Look and Feel page, to hold some logic to switch menus depending on category, etc. Maybe there's an example of that at themes.tikiwiki.org's "Template tricks" page.

-- Gary


Hi

Thanks for the reply. The "secondary site menu" is what I would like to use. There is not much documentation for this. Any chance of posting an example?


Here is the recipe.

1. Add a line such as {menu id=45 css=y type=horiz} to the 'Secondary site menu custom code:' box in 'Look and Feel general options. This will set the top menu which never changes

2. In the 'Site menu custom code ' box add something like

{if isset($objectCategoryIds) and in_array(1, $objectCategoryIds)}
{menu id=50 css=y type=horiz}
{elseif isset($objectCategoryIds) and in_array(2, $objectCategoryIds)}
{menu id=47 css=y type=horiz}
{elseif isset($objectCategoryIds) and in_array(3, $objectCategoryIds)}
{menu id=46 css=y type=horiz}
{elseif isset($objectCategoryIds) and in_array(4, $objectCategoryIds)}
{menu id=48 css=y type=horiz}
{else}
{menu id=51 css=y type=horiz}
{/if}

This will set the middle menu depending upon the category.

I hope this helps someone


Thank you for the above post.

I will be thankful if someone explains the nice above piece of code so that I can understand and implement it.

For example: what does the following line means

{if isset($objectCategoryIds) and in_array(1, $objectCategoryIds)}

Thanks in advance.