MenuItem - Liquid Object Reference

This article requires advanced skills to implement.
Liquid

Description

A MenuItem represents a link in a Menu. It can be a simple label with a link, or it might link to one of the following objects: * Article * ArticleCategory * Page * Product * ProductCategory

  MenuItems may contain child MenuItems.
ℹ️ Note

This object supports custom data via the data attribute.

Attributes

Attribute Type Description
article Article Returns the Article linked to this MenuItem
article_category ArticleCategory Returns the ArticleCategory linked to this MenuItem
child_categories List Returns a list of child categories for the linked object. Only relevant when linked_type is one of: article_category, page, product_category
child_category_levels Number Returns the number of levels to show for child categories
hidden? Boolean Returns true if this MenuItem is hidden
id String Returns the unique id for this MenuItem
identifier String Returns the value of the Identifier attribute
image Image Returns the Image for to this MenuItem
link_label String Returns the label for the link, based on its type and linked object (if any)
link_target String Returns the target url or path for the link, based on its type and linked object (if any)
link_type String Returns the type of link this is. It will be one of: article, article_category, page, product, product_category, link
menu Menu Returns the Menu linked to this MenuItem
menu_items List[MenuItem] Returns a list of MenuItems belonging to this MenuItem
name String Returns the name of this MenuItem
page Page Returns the Page linked to this MenuItem
parent_menu_item MenuItem Returns the parent MenuItem of this MenuItem
position Number Returns the position of this MenuItem
product Product Returns the Product linked to this MenuItem
product_category ProductCategory Returns the ProductCategory linked to this MenuItem
show_image? Boolean Returns true if this MenuItem should show an image
style_classes String Returns the CSS classes that should be added for this MenuItem
url String Returns the url that this MenuItem links to (if any)