Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

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

Started by bodigiti 9 years ago · 1 replies · 1551 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 webmasterodp, 7 days ago
4 151 6 days ago
Support · by nwhitfield, 1 week ago
2 131 1 week ago
Support · by stell, 3 weeks ago
5 364 2 weeks ago
Support · by gravinator, 1 month ago
5 556 2 weeks ago
Support · by Gravver, 3 weeks ago
6 344 3 weeks ago