Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Modular Pages: How to set default all modular pages to "onpage_menu: false"?

Started by bodigiti 8 years ago · 1 replies · 1366 views
8 years ago

Hi wWw;

I suppose you searching to use a modular page for your homepage but keep the regular menu instead of the onpage menu.

Modular are (dedicate) to onepage website.

To bypass this with a theme based on Quark
I copy the modular.html.twig call it homepage.html.twig
than remove everything between
{% extends 'partials/base.html.twig' %} and {% block hero %}

So when I select homepage as Page template I could use module on this page but also keep the regular menu.

TWIG
{% extends 'partials/base.html.twig' %}

{% block hero %}
    {% for module in page.collection() if module.template == 'modular/hero' %}
        <div id="{{ _self.pageLinkName(module.menu) }}"></div>
        {{ module.content }}
    {% endfor %}
{% endblock %}

{% block body %}
    <div style="margin-bottom: 122px;"></div>
    {% for module in page.collection() if module.template != 'modular/hero' %}
        <div id="{{ _self.pageLinkName(module.menu) }}"></div>
        {{ module.content }}
    {% endfor %}
    <div style="padding-left: 1.4rem;">
      {# check to display CC License - hibbittsdesign.org #} {# check to display git sync link in page - hibbittsdesign.org #}
      {% if theme_var('display_of_git_sync_repo_link') == 'page' and not (grav.uri.param('summaryonly')) %}
        {% include 'partials/git_sync_repo_link_note.html.twig' %}
      {% endif %}
      {% if theme_var('cc_license.enabled') %}
        {% include 'partials/creative_commons_license.html.twig' %}
      {% endif %}
    </div>
{% endblock %}

I hope this answer your question ;)

👍 2

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 53 11 hours ago
Support · by Anna, 3 days ago
2 60 13 hours ago
Support · by Justin Young, 14 hours ago
1 30 14 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago