getgrav / grav-theme-quark

MIT License
65 stars 59 forks source link

Navbar #150

Open mikeleord opened 4 years ago

mikeleord commented 4 years ago

Hello I created the home page with modular page, but the menu with the other pages is not visible. no menu instead on the rest of the site it's ok. menu ok if I remove a piece of code from modular.html.twing the first page shows the menu correctly. {% block header_navigation %} {% if show_onpage_menu %} <ul class="navigation"> {% for module in page.collection() if module.header.visible is not same as(false) %} {% set current_module = (module.active or module.activeChild) ? 'active' : '' %} <li><a class="{{ current_module }}" href="#{{ module.menu|hyphenize }}">{{ module.menu }}</a></li> {% endfor %} {% for mitem in site.menu %} <li> <a {% if mitem.class %}class="{{ mitem.class }}"{% endif %} href="{{ mitem.url }}"> {% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %} {{ mitem.text }} </a> </li> {% endfor %} </ul> {% else %} {{ parent() }} {% endif %} {% endblock %} sorry but I don't understand where I'm wrong. can you help me

tomorrowsj commented 2 years ago

I have met the same problem and already solved it. In the "partials/base.html.twig", original text are:

you should change to

that means just put the {% include 'partials/navigation.html.twig' %} out of the index. that's because in modular.html.twig the "site.menu" is not defined.