MenuItem - Liquid Object Reference
On this page
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.
:::
Backed by
This drop renders the s_c__Menu_Item__c Salesforce object. A theme writes it as menu_item.
| Liquid attribute | Salesforce field |
|---|---|
identifier |
s_c__Identifier__c |
name |
s_c__Display_Name__c |
position |
s_c__Position__c |
style_classes |
s_c__Style_Class_Names__c |
url |
s_c__URL__c |
Every other attribute on this drop is derived by StoreConnect rather than read straight from one field. The Attributes section lists them all.
Fields you add yourself are not listed above. Expose one with a Custom Data Mapping record, then read it from menu_item.data. See custom data fields in Liquid.
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) |
Available on
- Menu - Liquid Object Reference —
menu_items
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.