{% doc %} Renders one item of the storefront navigation. Parent links with nested items include a submenu. The same markup is used on desktop and mobile. @param {string} title - Link label @param {string} url - Link URL @param {link[]} [child_links] - Nested links from a menu @param {string} [child_menu] - Fallback items as `Label::/url`, separated by `|` @param {boolean} [show_caret] - Shows a decorative caret when there are no child links @example {% render 'header-menu-item', title: link.title, url: link.url, child_links: link.links %} {% enddoc %} {% liquid assign child_count = 0 assign manual_items = blank if child_links != blank and child_links.size > 0 assign child_count = child_links.size elsif child_menu != blank assign manual_items = child_menu | strip | split: '|' assign child_count = manual_items.size endif %}
  • {{ title }} {% if child_count > 0 %} {% elsif show_caret %} {% endif %}