Mobile Menu for Modular Page (Grav issue)

I’ve found a solution for problem with with mobile menu in Grav CMS. Read more for details.

In Gravs default themes there are no modular sections links in the mobile menu.

To fix that simply edit user/themes/[your theme]/templates/partials/base.html.twig mobile-container section like that:

    <div class="mobile-container">
        <div class="overlay" id="overlay">
            <div class="mobile-logo">
                {% include 'partials/logo.html.twig' with {mobile: true} %}
            </div>
            <nav class="overlay-menu">
               {{ block('header_navigation') }}
            </nav>
        </div>
    </div>

Using block function instead of include you’ll repeat upper menu in the mobile container so it will be the same in both places.

This particular issue is described on Gihub:

https://github.com/getgrav/grav-plugin-admin/issues/421

Published by

Konrad Fedorczyk

I'm interested in programming and gamedev. I especially luv HTML5 and everything connected to web technologies.

4 thoughts on “Mobile Menu for Modular Page (Grav issue)”

  1. Thank you for your solution, that works. Unfortunately the mobile menu stays in front after klicking an entry. So you have to press the ‘X’ in the top right to close the menu. Is there any workaround?

Leave a Reply

Your email address will not be published.