link
Menu navigation links.
To learn how to implement menu navigation in your theme, refer to Adding Menu Navigation to Themes.
Properties
Returns true if the link is active. Otherwise, returns false.
A link is regarded as active if the current URL path matches the link's URL. For instance, if the current URL path is /blog/tag/cutlery, the following link URLs would be regarded as active:
/blog/tag/cutlery/blog/tag
The link.active property is useful for designing the appearance of the currently selected menu navigation. For instance, if a customer is viewing an article in the "Tag" blog, the "Tag" link would be highlighted in the menu.
Returns true if the link's child links are active. Otherwise, returns false.
A link is considered active if the current URL path matches or contains the link's url.
For instance, if the current URL path is /blog/tag/cutlery, the following link URLs would be regarded as active:
/blog/tag/cutlery/blog/tag
Returns true if the current URL path aligns with any of the link's child URLs. Otherwise, it returns false.
Ignore parameters when matching URLs. Product URLs within a collection context using the within helper are treated the same as standard product URLs.
Returns true if the current URL path corresponds to the link's URL. Otherwise, it returns false.
Ignore parameters when matching URLs. Product URLs within a collection context using the within helper are treated the same as standard product URLs.
The link's handle.
The quantity of nested levels beneath the link.
The child links of the link.
Example
Check the number of links.
The title of the link.
The type of the link.
| Property Value | Description |
|---|---|
| article_link | The link directs to an article. |
| blog_link | The link directs to a blog collection. |
| catalog_link | The link directs to all product collections. |
| collection_link | The link directs to a product collection. |
| collections_link | The link directs to a collection list page. Collection list page. |
| frontpage_link | The link directs to the homepage. |
| http_link | The link directs to an external webpage. |
| page_link | The link directs to a custom page. |
| policy_link | The link directs to a policy page. |
| product_link | The link directs to a product page. |
| search_link | The link directs to a search page. |
The URL of the link.