Menu
Use the menu
helper to render menus.
Arguments
String
The menu identifier.
Parameters
list
Flag to list directory content (default:false
).include-index
Include the index file when listing directory content (default:false
).depth
Maximum depth when listing directory content (default:1
).path
Optional directory to list.
info
Use depth=0
to get all the descendants of a folder; the listing will use the default maximum folder depth for traversal which is 64.
Local Variables
@self
: Set totrue
when a path matches the current page.
Example
Render a named menu:
Render a menu of pages in the current folder excluding the index page:
Render a menu of pages in the current folder and include the index page:
Render a menu including all the descendants of the current folder upto the the maximum depth:
Iterate the pages in a menu and exclude the current page:
Iterate the pages in the current folder (list=true
is inferred):
Iterate all the pages in a specific folder upto the maximum folder depth: