Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

Started by bodigiti 9 years ago · 1 replies · 1646 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 TomW, 2 weeks ago
8 227 9 hours ago
Support · by alex, 2 months ago
8 667 23 hours ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 159 3 days ago
Support · by TomW, 6 days ago
2 106 5 days ago