{{ menu_item }}

FieldTypeDescription
object_typestring"menu_item"
is_validTrue|FalseTrue if this references a menu_item or false if the menu_item is null
guidguid
menu_guidtext_field
menumenu
parent_menu_item_guidtext_field
parent_menu_itemmenu_item
nametext_field
hrefurl_field
open_in_new_tabboolean
descriptiontextarea_field
contenthtml_field
image_guidtext_field
imageimage
depthnumber
ordernumber
itemsmenu_itemsA list containing all of the menu items that are direct children of the current menu item.
valuestringSynonymn for guid
outputhtmlThe default output that the menu_item produces when output directly to the template.
output_in_listhtmlThe default output that the menu_item produces when output directly to the template as part of a list.

Contains multiple menu_items.

FieldTypeDescription
object_typestring"menu_items"
is_validtrue/falsetrue if this contains at least one menu_item
prependedlist of menu_itemsmenu_items that will be listed at the beginning of the items list
fetchedlist of menu_itemsThe primary list of menu_items to be included in the items list
appendedlist of menu_itemsmenu_items that will be listed at the end of the items list
appended_uniquelist of menu_itemsmenu_items that will be listed at the end of the items list, excluding any menu_items that are already included in either the prepended or fetched lists
itemslist of menu_itemsThe full list of menu_items in the proper order and uniqueness, including prepended, fetched, and appended menu_items
sizenumberThe total number of items in the list of items, including prepended, fetched, and appended menu_items
limitnumberThe maximum number of menu_items that could have been fetched dynamically from the database
startnumberThe 1-based index of the first menu_item that was (or would have been) dynamically fetched from the database
pagenumberThe 1-based index of the first "page" of menu_items that could have been fetched dynamically from the database - as determined by the start and limit properties
total_countnumberThe total number of menu_items in the database that matched the provided filter parameters when fetching the list of fetched menu_items
total_pagesnumberThe total number of "pages" of results that matched the provided filter parameters when fetching the list of fetched menu_items - as determined by the total_count and limit properties
outputhtmlThe default output that the menu_items will produce when it is output directly to the template - using the "output_in_list" property of each menu_item in the items list

Examples

Fetching Menu Items

Copy
{% menu var mainMenu = "Main" %} {% for item in mainMenu.items %} {{item.title}} {% endfor %}

Methods

{% menu_item %}

Fetch a single menu_item.

{% menu_item
[var|set|assign] new_variable_name
Specify a variable name in order to save the menu_item to a variable. If not specified the menu_item will be output to the template instead. The variable will be saved using the "var" behavior unless "set" or "assign" are specified.
output_to_template
If included, the menu_item will be output directly to the template.
=
menu_item|guid|string
%}

{% menu_items %}

Fetch a list of menu_items.

{% menu_items
[var|set|assign] new_variable_name
Specify a variable name in order to save the results to a variable. If not specified the results will be output to the template instead. The variable will be saved using the "var" behavior unless "set" or "assign" are specified.
output_to_template
If included, the results will be output directly to the template.
=
prepend:menu_item|menu_items|guid|string
Prepend the specified menu_items at the beginning of the items list. All prepended input will be returned in the same order that it is input.
append:menu_item|menu_items|guid|string
Append the specified menu_items at the end of the items list. All appended input will be returned in the same order that it is input.
unique:true
If set to true, each of the resulting lists (prepended, appended, and items) will be unique, although there may be duplicates between the prepended, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first then appended items.
max_size:25
If specified, then the "items" list will only include up to the specified number of menu_items
%}