Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

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

Started by bodigiti 8 years ago · 1 replies · 1513 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 complanar, 6 days ago
6 140 16 hours ago
Support · by Rick Beebe, 6 days ago
2 100 2 days ago
Support · by blu3prince, 3 days ago
0 52 3 days ago
Support · by alex, 4 days ago
2 92 3 days ago
Support · by Marcel, 2 weeks ago
1 143 4 days ago