Menu Builder automatically displays existing pages on the left-hand side for you to add to the menu, which is on the right hand side. To add menu items that link to WebApp items, or to external links; add an existing page and click on the link icon to edit the fields. You can fully customise all fields from here.


{%- include 'menu', id:'6560', layout: 'default', name: 'Main Navigation' -%}


id - the Menu's ID
layout - default is /default/ - 'layout' values are relative to the folder: layouts/modules/menu (module_2)/[layout name]
name - name of the Menu

Liquid Tags

Field Name: Current Level Menu Items
Liquid Tag: {% include 'modules/siteglide_menu/get/get_items', item_layout: 'item' -%}
Description: outputs all top level menu items with li. Should be used in wrapper.liquid

Field Name: Current Level Name
Liquid Tag: {{ this['link_name'] }}
Description: outputs Menu item name. should be used in item.liquid

Field Name: Current Level URL
Liquid Tag: {{ this['link_url'] }}
Description: URL of the item

Field Name: Current Level custom class
Liquid Tag: {{this['link_class']}}
Description: Class field contents for current item

Field Name: Sub Levels Menu Items
Liquid Tag: {% assign _next_level = _level | plus: 1 -%} {% include 'modules/siteglide_menu/get/get_items', level: _next_level, parent_id: this['forced_id'], item_layout: 'item' -%}
Description: outputs all sub level menu items with the current layout applied. Should be used in item.liquid. This essentially creates a loop until it reaches the bottom level of your menu

Field Name: Mark As Parent
Liquid Tag: {{ this['is_parent'] }}
Description: an invisible field used to define if an item has sub-items or not. If item has sub items it's value will be: true if an item does not have sub items it's value will be: false

Layout Files

Menu Builder Module layouts are stored in the following folder structure, which you can view via Code Editor: layouts/modules/Menu (module_2)/

Within this module folder you will find the following layout folders:

default/ - the layout folder
    item.liquid - menu item file
    wrapper.liquid - menu item wrapper file

Example - wrapper.liquid

The wrapper file is used to wrap the menu item output and should contain the liquid for outputting the menu items. You can wrap your menu with any content you'd like, such as a plain <ul> tag, or a section wrapper with a title.

{% include 'modules/siteglide_menu/get/get_items', item_layout: 'item' -%}

Example - item.liquid

The item file is the chosen output for our items. In this example we've got two cases being used.

{% if this['is_parent'] -%}
    <a href="{{this['link_url']}}">{{this['link_name']}}</a>
    {% comment %} Wrap children in ul, set the next level, and then get the children {% endcomment %}
      {% assign _next_level = _level | plus: 1 -%}
      {% include 'modules/siteglide_menu/get/get_items', level: _next_level, parent_id: this['forced_id'], item_layout: 'item' -%}
  {% comment %} Else just output the item by itself {% endcomment %}
{% else -%}
    <a href="{{this['link_url']}}">{{this['link_name']}}</a>
{% endif -%}

1. The item is a parent, so has sub items.

  • This means we output the item, and then increment the 'level' value in order to output this item's sub-items.

  • In this case, we use the same item output for every level. You may want a different file for each level. To do that, on line 8 you should set the item_layout as 'level2' for example. Then you should create a new copy of this 'item' file called 'level2' and put your new layout for the second level there. Alternatively, you can target each level in an {% if -%} statement, but we suggest using new files to separate the layouts more easily.

  • Since we use this same layout for every level, it loops until the bottom level, where the item is no longer a parent.

2. The item has no sub-items

  • This means we simply output the item, and nothing else.

Did this answer your question?