Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar #150

Open
mikeleord opened this issue Jul 7, 2020 · 1 comment
Open

Navbar #150

mikeleord opened this issue Jul 7, 2020 · 1 comment

Comments

@mikeleord
Copy link

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
Copy link

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

{% block header_navigation %} {% include 'partials/navigation.html.twig' %} {% endblock %} you should change to {% include 'partials/navigation.html.twig' %} {% block header_navigation %} {% endblock %} 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants