Hello everybody,
while developing my first site with GRAV, I’d like to set up a second navigation (footer). For this second navigation, I created a new folder in /user/ and tried to get the base.twig.html to read it out – not very successful.
Is there an easy way to set up a second nav just like the nav with pages-folder?
I think the best way is to put something like that in your site.yaml:
footer_menu:
- url: "your_url_here"
text: facebook
- url: "your_url_here"
text: twitter
Then create footer_menu.html.twig in templates/partials, find a place to include it in your base.html.twig.
Then include it like that:
{% include 'partials/footer_menu.html.twig' %}
And the last step, add following code in footer_menu.html.twig
<ul>
{% for item in site.footer_menu %}
<li><a href="{{ item.url }}">{{ item.text }}</a></li>
{% endfor %}
</ul>
That’s it. You should have your additional custom footer menu added.
Great, it works. Thank you!