Hey!
I am making a site that includes several modular pages. The one page menu works great for each modular page, but I wish to show the main menu on all sub-modular pages, I know it can be done, but tried so many different things that I have to ask.
I have tried and some more:
{% if page.header.level1menu %}
{% if page.header.level1menu == true %}
{% if find.page("/en/1st-level/health") == true %}
Let me explain what in need in the code:
=== Start of problem
{% if in a sub-modular page then show %}
=== End of problem
<div class="row">
<nav class="nav">
{% if theme_config.dropdown.enabled %}
{{ _self.loop(pages) }}
{% else %}
{% for page in pages.children.visible %}
{% set current_page = (page.active or page.activeChild) ? 'selected' : '' %}
<li class="nav-item {{ current_page }}">
<a href="{{ page.url }}" class="nav-link active">
{% if page.header.icon %}<i class="fa fa-{{ page.header.icon }}"></i>{% endif %}
{{ page.menu }}
</a>
</li>
{% endfor %}
{% endif %}
{% for mitem in site.menu %}
<li>
<a href="{{ mitem.url }}">
{% if mitem.icon %}<i class="fa fa-{{ mitem.icon }}"></i>{% endif %}
{{ mitem.text }}
</a>
</li>
{% endfor %}
</nav>
</div>
=== Ending problem if
{% endif %}
=== Ending problem if
<div class="row">
{% if show_onpage_menu %}
<nav id="sticky-top" class="nav w-100 green1bg">
{% for module in page.collection() %}
{% set current_module = (module.active or module.activeChild) ? 'active' : '' %}
<li class="nav-item {{ current_module }}"><a href="#{{ _self.pageLinkName(module.menu) }}" class="nav-link">{{ 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 %}
</nav>
{% else %}
{{ parent() }}
{% endif %}
</div>
{% endblock %}
{% block content %}
{{ page.content }}
{% for module in page.collection() %}
<div id="{{ _self.pageLinkName(module.menu) }}"></div>
{{ module.content }}
{% endfor %}
{% endblock %}
My goal is to show the main menu if in a sub-modular page.
Thank you