nav

Description

Render a list of links pointing to your pages. You can specify a context from where the pages will be pulled out. The context takes the following values: site, parent or page.

Moreover, it is also possible to include the nested pages.

Your pages must fill 2 conditions to be part of the navigation: be published and be listed.
The order is based on the one you specify in your LocomotiveCMS back-office.

Syntax

{% nav <origin>(, <options>) %}

Example

{% nav 'parent', depth: 1, no_wrapper: false, exclude: nil, icon: false %}

a more complex example:

{% nav site, exclude: '\.*\-bottom', depth: 2, snippet: menu_entry %}
{% block misc_properties %}
  {% editable_text menu_teaser %}{% endeditable_text %}
  {% editable_file menu_image %}{% endeditable_file %}
{% endblock %}

nav tag in the page

{{ page.menu_teaser }}
{{ page.menu_image }}

snippet named "menu-entry"

Options

Name Type Description
depth Integer how many levels of children to display. 1 by default.
snippet String name of the snippet which will be used to render a page entry. Optional.
no_wrapper Boolean do not output the nav and ul wrapper tags. false by default.
exclude String regexp string of slugs to be ignored.
icon String ouput a span to be used as an icon.
id String css unique identifier for the nav tag. "nav" by default.
class String class of the nav tag.
active_class String name of the css class when the current page is the one in the menu.
bootstrap Boolean use the twitter bootstrap classes. false by default
© 2024 LocomotiveCMS Terms of use Privacy Policy
Back to top