For Jekyll users who want a simple solution for creating navigation menus using DatoCMS. Use a Links model in the CMS and It will output the following data file under the Navigation model:
footer-menu:
- title: Amsterdam, Center
url: amsterdam-center
- title: Amsterdam North
url: amsterdam-north
- title: Amsterdam, West
url: amsterdam-west
- title: Amsterdam, South
url: amsterdam-south
main-menu:
- title: Home
url: home
- title: Products
url: products
- title: Contact
url: contact
This means you can access each menu in a simple liquid foreach
loop:
<ul>
{% for item in site.data.navigation.main-menu %}
<li>
<a href="{{ item.url }}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>