-
Notifications
You must be signed in to change notification settings - Fork 7
Menu system
Menus are lists of links and sublinks that can be used for navigating through your site.
To create a menu, go to the menu interface in the structure section of the administration toolbar.
Hit edit next to an existing menu or create a new one by selecting the create new menu button.
To embed a menu in the theme either use a menu block if the menu block module is enabled or use a menu embed template in an HTML template. An optional template
parameter can override the menu template.
{{{iris embed='menu' menu="admin_toolbar"}}}
The default menu.html template can be found in the menu module's template folder. iris_core/modules/core/menu/templates/menu.html
This can be overridden by a theme or module (for more information look at the template naming and lookup documentation).
The menu template lookup also takes an additional parameter of the menu name so you can create a template for a specific menu using menu_menuname.html
When defining a custom Express route in code using iris.route
you can add it to a menu by passing through a menu
object to the route's options. See routing system documentation for more information.
The only required parameter is menuName
for the name of the menu (registered automatically as soon as a link is created for it). It makes sense to also include a title
for where the menu is displayed. parent
is used for when the menu item is a child of another item in the menu. Write in the path of this parent. An optional path
parameter will let you use a custom path for the menu (it defaults to the path of the route).
As an example:
iris.route.get("/admin/structure", {
"menu": [{
menuName: "admin_toolbar",
parent: "/admin",
title: "Structure"
}]
}, function (req, res) {
// Logic for your route
});
- Setting up an Iris site
- Folder structure
- Module system
- Restarting the server after code changes
- Hook system
- Entity system
- Theme and template system
- Form system
- Text filters
- Message system
- Routing system
- Sessions, authentication, user and permission systems
- Configuration system
- Menu system
- Translation system
- Triggers
- Websocket system
- Logs
- Adding tags (meta, css, javascript) to templates dynamically
- Block and region system