Field | Type | Description |
object_type | string | "menu" |
is_valid | True|False | True if this references a menu or false if the menu is null |
guid | guid | |
name | text_field | |
items | menu_items | A list containing all of the top-level menu_items in the current menu. |
value | string | Synonymn for guid |
output | html | The default output that the menu produces when output directly to the template. |
output_in_list | html | The default output that the menu produces when output directly to the template as part of a list. |
Contains multiple menus.
Field | Type | Description |
object_type | string | "menus" |
is_valid | true/false | true if this contains at least one menu |
prepended | list of menus | menus that will be listed at the beginning of the items list |
fetched | list of menus | The primary list of menus to be included in the items list |
appended | list of menus | menus that will be listed at the end of the items list |
appended_unique | list of menus | menus that will be listed at the end of the items list, excluding any menus that are already included in either the prepended or fetched lists |
items | list of menus | The full list of menus in the proper order and uniqueness, including prepended, fetched, and appended menus |
size | number | The total number of items in the list of items, including prepended, fetched, and appended menus |
limit | number | The maximum number of menus that could have been fetched dynamically from the database |
start | number | The 1-based index of the first menu that was (or would have been) dynamically fetched from the database |
page | number | The 1-based index of the first "page" of menus that could have been fetched dynamically from the database - as determined by the start and limit properties |
total_count | number | The total number of menus in the database that matched the provided filter parameters when fetching the list of fetched menus |
total_pages | number | The total number of "pages" of results that matched the provided filter parameters when fetching the list of fetched menus - as determined by the total_count and limit properties |
output | html | The default output that the menus will produce when it is output directly to the template - using the "output_in_list" property of each menu in the items list |
Fetch a single menu.
{% menu[var|set|assign] new_variable_nameSpecify a variable name in order to save the menu to a variable. If not specified the menu will be output to the template instead. The variable will be saved using the "var" behavior unless "set" or "assign" are specified.output_to_templateIf included, the menu will be output directly to the template.=menu|guid|string%}
Fetching Menu Items
CopyFetch a list of menus.
{% menus[var|set|assign] new_variable_nameSpecify 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_templateIf included, the results will be output directly to the template.=prepend:menu|menus|guid|stringPrepend the specified menus before the fetched results. All prepended input will be returned in the same order that it is input.append:menu|menus|guid|stringAppend the specified menus after the fetched results. All appended input will be returned in the same order that it is input.exclude:menu|menus|guid|stringPrevent the specified menus from being included in the fetched results. Has no affect on prepended and appended menusexclude_prepended:trueSpecifically exclude all prepended menus from the fetched results. If "unique:true" is specified this is the default behavior, although you may also specify "exclude_prepended:false" to allow any prepended items to be fetched along with other results anyway.exclude_appended:trueSpecifically exclude all appended menus from the fetched results. This is false by default - even if "unique:true" is specified - so that results are returned in the proper order.unique:trueIf set to true, each of the resulting lists (prepended, fetched, appended, and items) will be unique, although there may be duplicates between the prepended, fetched, and appended lists. The "items" list will include objects in the order in which they appear - with prepended items first, then fetched items, then appended items.max_size:25If specified, then the "items" list will only include up to the specified number of menus. The "limit" may be automatically lowered to only fetch the maximum number of menus that will be included in "items" following prepended items. Note that this may also impact both the "page and "total_pages" values. In order to use pagination with a list loaded using "max_size" use "start" instead of "page" and "limit".date_created_start:datetimeFilter results to return menus for which date_created is greater than or equal to date_created_start.date_created_end:datetimeFilter results to return menus for which date_created is less than or equal to date_created_end.start:1Set the 1-based index of the first menu to fetch.page:1Automatically calculate the first menu to fetch based on both of the "limit" and the 1-based "page" value. Ignored if "start" is set.limit:25Defines the maximum number of menus to be fetched. If not included, this will default to 10. Note that if "max_size" is specified then "limit" may be automatically lowered even if specified.sort_by:"date_created"Specify which field to sort the fetched results by. Has no affect on prepended or appended menus.
By default results will be sorted by date_created (the date the item was first published) desc (newest first).
Other Options include:
- Name
- date_created (Equivalent to the date you first published this item. Unpublishing and republishing the item resets date_created to the current date)
- random (By default using random sorting prevents fast caching of the page. Setting "cache_random:true" overrides this behavior and allows the page to be fast-cached anyway)
sort_direction:"desc"Specify whether the fetched results should be sorted in asc (ascending) or desc (descending) order.%}
If you do not include any filters or inputs other than prepended items, appended items, or max_size, then no additional items will be fetched. If you wish to fetch all items you must include at least one additional input (ie: "start:1")