Custom Menus | |
More screenshots are needed In Tiki you can use the admin-menus panel, or a wiki page, or a structure to create a custom menu. Menus and many other things can be placed into custom "user" modules using the Smarty
Also, in vertical Bootstrap menus, child items display straight down, whereas superfish menu "dropdowns" fly out horizontally. Finally, Bootstrap menus are limited to two levels (parent and child) (but see "Smartmenus" below), while superfish menus can have up to four levels. The type of menu is specified on the admin-modules page, when the menu-containing module is assigned to a module zone. Since Tiki 20, Smartmenus functionality has been added to Tiki. Smartmenus enhance Bootstrap menus in these ways, among others:
To activate Smartmenus, go to the "Interface" tab of the "Features" admin page (tiki-admin.php?page=features#contentadmin_features-interface) . Smartmenus come with several themes or "modes", but for visual consistency with Tiki's themes, "None" should be selected. The feature is then automatically applied to every horizontal Bootstrap menu, such as in navbars. Support for vertical Bootstrap menus is still being worked out, so stay tuned. In the meantime, superfish menus can be used to get the same behavior. When fully integrated, Bootstrap + Smartmenus should make CSS superfish menus redundant.
Tip For an easy, community editable menu use Module menupage, which creates a menu from the menu construction content of a designated wiki page.
|
Creating a Custom Menu | |
insert screenshot here
insert screenshot here
insert screenshot here
|
Creating menus from structure tocs | |
See Structures User You can either make a navigation menu from a "menu Id" or from a "structure Id". |
Configuring a Custom Menu | |
Once created, click the configuration button on this new menu's row, which will take you to /tiki-admin_menu_options.php?menuId=n To create a menu item, fill in the edit menu options form: at least Name, URL (relative or absolute), Type = "option" and Position which is a number to set the menu item order. Save and look at the Preview of the menu.
To create a section (i.e. a folder) that can be opened or collapsed, fill in the edit menu options form with at least Name, URL, Type = "section" and Position. NOTE: Do not put anything in Sections unless you know the Tiki specific feature references e.g. feature_wiki or feature_blog_rankings. These can be auto-filled using Some useful URLs pull-downs, or look at the Tips below to know how to guess the section name of the feature you are interested in.
|
Example | ||||||||||||||||||||||||||||||||||||||||||||||||
will be
|
Allow viewing options/sections only under some conditions | |
Normally, the visibility of a menu item for a particular user is determined by the visibility of the link target for that user. In other words, if a user doesn't have permission to see "blog 3", then the "blog 3" link won't be visible to that user. This is done automatically by Tiki - no special effort is needed when making the menu. But to explicitly add permissions for menu-item visibility, see the next section. |
Allow only to some specific groups | ||||||||||||||||||||||||
You can restrict the view of some options and sections in the menu, so that only specific groups can view them. For instance, you could add a "User Preferences" option in position 100 to your customized menu that is seen by users only when they log in (registered group). To do this, you would add:
If you want a list of groups to see the option, = a user to be only in one of the groups to see the option, you have to insert has many options as groups. Each option must have the same parameters (same position, ...) except for the group. The trick is, if you don't select any Groups, everyone can see the menu option. If you want to exclude a group, select all the other groups (but not the group you want to exclude). Similarly, you can inadvertently exclude a logged-in group by selecting too many groups. You don't need to select all of your Admin-type groups (they can usually see everything anyway). Just select the one logged-in group that you want to able to see the menu item. (Yes, this is all very weird.) |
Allow only if feature X is enabled | ||||||||||||||||||||||||
Imagine you want to add the option "Users Map" in position 110, to anonymous or registered groups, only when the feature Google Maps (gmap) is enabled in your site. You can do that with:
|
Allow only if feature X enabled and if user in a group with given permission | ||||||||||||||||||||||||
You could also restrict the menu option to be seen when the feature X is enabled, but also only when the user belongs to a group which has a specific permission. For instance, you could add an option "Upload image" in position 120 which is seen only when the feature image galleries (feature_galleries) is enabled AND only by users in groups which have the permission to upload images (tiki_p_upload_images). To achieve this behavior, you have to add something like:
|
Tips | |
|
Include menu in a new user module or in templates | |
Once the menu has all or most of the options go to "Admin Modules" page (/tiki-admin_modules.php), under " Create new user module" at the bottom, find your menu title in the pull-down "Menus" on the right, click use menu and "{menu id=n}" (where n = your menu ID) will appear in the "Create new user module" data box. Add a title (what will users will see) and a name (what admin sees) and click create/edit. Now you have created a new user module for the custom menu. |
Multilingual menu | |
|
CSS (Superfish) Menus | |
Superfish/Suckerfish menu deprecated from Tiki25 See explanations below to make the transition between Tiki24 and Tiki25 is you were using it.
Then back on the Settings, General, Navigation (tiki-admin.php?page=general#contentadmin_general-3) enable "Smartmenus".
Due to this and other related changes from Tiki24 to Tiki25 it is possible you have to adjust the design of your menus.
To recap: a menu created in Admin Menus can be displayed in one of four ways: a Tiki legacy (pre-CSS/pre-Bootstrap) menu, a Bootstrap menu, a Superfish menu, or a Bootstrap + Smartmenus menu. Once the menu is created, it can be display at the site either directly in a module, in a template file {menu id=1} or in Admin Look and Feel (custom code). To have a Superfish menu used in a module (via admin) or a template (via file editing) add the parameter css=y to the smarty tag {menu}.
|
Additional Parameters | ||||||||||||||||
|
Contextual menu example | |
Imagine this menu (id=101)
will display when you are on rose, or flower or monaco
Three steps to a contextual menu
Please mind, that this custom-contextual-menu will only show items, when you are "on a page" that is linked from the menu.
Example:
|
ur | |
External Links in Menus target | |
If you want to let external links be opened in a new Tab or window, you need a target=_blank.
Copy to clipboard
And it will only work, if you enable the following in the admin panel "general settings -> navigation": Copy to clipboard
|
other attributes | |
Other attributes like " rel="box which opens mainly anything in a nice pop up box, if "colorbox" is activated, should work in the same way. |
Links in iframe | |
Links to be opened inside an iframe in the main display area can be done this way ( Featured Links feature has to be enabled): Copy to clipboard
|
Perms | |
|
Change the folder icons of a Tiki menu | |
There are 2 ways to change the folder icons
2)to change locally for a menu. You must specify the path to the icon folder for close section like my_modifications/my_icon.gif and you must supply this icon and the closed icon that must be name my_modifications/omy_icon.gif (notice the o letter) For the change to take effect, you may have to clear Tiki's caches (at tiki-admin_system.php) and your browser cache, and/or log out of Tiki to clear session information. |
Add icons to each option of a menu | |
First, you need to activate the general preference in:
Finally, for each option, you can give the name of the file containing the icon (the file will be fetched from the directory you specified at: Settings > Control Panels > Admin > General > Navigation > Menus > 'Default path for the icons') or you can give the path of an icon relative to tikiroot. |
Drag and drop | |
Since Tiki18 menu management allows drag and drop of items.
|
See also | |
For more information about creating menus only for specific groups see: Tutorial - HowTo Create Menus
Alias
|