History: MultiLevelMenus
Preview of version: 6
Table of contents
Tikiwiki version: 1.8.5.
[-]
This solution is heavily based on initial work by xia (Forum post
).
Let's say we want to have a menu that's collapsed by default. Upon expanding it should be like this:
1. Open templates/tiki-admin_menu_options.tpl
Find:
<option value="o" {if $type eq 'o'}selected="selected"{/if}>{tr}option{/tr}</option>
Add below:
<option value="p" {if $type eq 'p'}selected="selected"{/if}>{tr}submenu1{/tr}</option> <option value="q" {if $type eq 'q'}selected="selected"{/if}>{tr}submenu2{/tr}</option>
('p', 'q', 'submenu1', 'submenu2' can be any names you choose)
Save and close.
2. Open lib/smarty_tiki/function.phplayers.php
Find:
if ($cd["type"] == 'o' and $indented) { $output.= ".";
Add below:
} elseif ($cd["type"] == 'p') { $output.= ".."; } elseif ($cd["type"] == 'q') { $output.= "...";
Save and close.
3. Click on 'Admin' menu and then 'Features'. Tick 'PhpLayers Dynamic menus' and press 'Change preferences' button.
4. Admin -> Menus. Create a new menu of 'dynamic collapsed' type. Configure the menu to add menu items.
5. Admin -> Modules. Scroll down to 'Create new user module' section. Give it a name, title. The latest menu we just created should be selected for 'phpLayersMenus:' drop-down (not the regular menus dropdown). Click on 'use phplayermenu' and press 'create/edit'.
6. Assign the module to set it left or right at a desired order.
Top Menus
[-]
You can have multi-level top menus, too:
Edit templates/tiki-top_bar.tpl and add the following as the last line:
{phplayers id=43 type=horiz}
...where 43 is the number of the menu you want to display (on siridhar's Tiki install, 43 happens to be the 'SubMenus demo' menu ID). Maybe one day Tiki will have configurable top and bottom menus 🙄.
If your prefered theme overrides templates/tiki-top_bar.tpl (with a local copy in templates/styles/XXX/) and doesn't support dynamic top menus by default, you could ask the theme designer to add the feature, or do it yourself (edit the loal copy in the same way, putting the phplayers line at the bottom of the file).
Tikiwiki version 1.9
Sorry, this functionality isn't currently available in 1.9 due to the menu refactoring work
[+]
Live Demo
You can check siridhar's live demo at http://sridharkatakam.com/tiki/
. (seems the link is nomore valid)
History
| Information | Version | |||||
|---|---|---|---|---|---|---|
| Gary Cunningham-Lee Missing tree images can be found in 1.9.5 directory, not 1.9.4. | 8 | |||||
| Gary Cunningham-Lee 1.9.4 procedure and new demo link added. | 7 | |||||
| luci | 6 | |||||
| Marc Laporte ading to category | 5 | |||||
| Michael Davey | 4 | |||||
| Michael Davey integrated my initial top menus notes into the document flow using siridhar's images | 3 | |||||
| Michael Davey | 2 | |||||
| Sridhar Katakam | 1 | |||||