Skip to content

Instantly share code, notes, and snippets.

@ankedsgn
Last active May 7, 2018 12:50
Show Gist options
  • Save ankedsgn/b89ae937eec174107f2459115c32659d to your computer and use it in GitHub Desktop.
Save ankedsgn/b89ae937eec174107f2459115c32659d to your computer and use it in GitHub Desktop.
Get raw menu from Bolt, no submenus, do something after halfway through loop
{% set footerthemamenu = app.config.get('menu/samen-verder') %}
<ul>
{% for item in footerthemamenu %}
{# Get record of the menu item, to create the real routes #}
{% setcontent itemrecord = item.path %}
<li>
<a href="{{ itemrecord.link }}">{{ item.label }}</a>
</li>
{% if loop.index == ((footerthemamenu|length)/2)|round(0, 'ceil') %}
{# close list and open a new one after hald of the loop #}
</ul>
<ul>
{% endif %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment