Skip to content

Instantly share code, notes, and snippets.

@reatlat
Created April 22, 2023 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reatlat/8a4f088af8a9a4f787e4eb9deb2f4f28 to your computer and use it in GitHub Desktop.
Save reatlat/8a4f088af8a9a4f787e4eb9deb2f4f28 to your computer and use it in GitHub Desktop.
HubSpot simple menu example
{% set node = menu(module.menu_field) %}
<ul>
{% for child in node.children %}
<li class="{{ 'has-children' if child.children }} menu-main-item-{{child.level}}">
<a href="{{child.url}}" target="{{ child.linkTarget }}">{{ child.label }}</a>
{% if child.children %}
<ul style="background: yellow">
{% for child2 in child.children %}
<li class="menu-child-depth-{{child2.level}}">
<a href="{{ child2.url }}" target="{{ child.linkTarget }}">{{ child2.label }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment