grav-plugin-maintenance icon indicating copy to clipboard operation
grav-plugin-maintenance copied to clipboard

Sidebar is still visible in maintenance mode

Open ilu33 opened this issue 6 years ago • 6 comments

If I install and activate the maintenance plugin the navigation still shows up. The desired effect in maintenance mode is that you see only the maintenance mode announcement and NOTHING from the site, not even the navigation.

https://github.com/getgrav/grav-theme-learn2/issues/82

ilu33 avatar Jul 11 '19 17:07 ilu33

Solution to this annoying but ignored problem as long as the menu uses a sidebar: Modify maintenance template like this

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

{% block sidebar %}
{% endblock %}

{% block content %}
...

This should be the default.

Depending on your theme you might need to copy and rename the theme's base template to a maintenance-specific version and hide some other menu elements there.

ilu33 avatar Jul 15 '19 15:07 ilu33

As themes are completely customizable there’s no way way to know if there is a particular block that needs hiding. The solution is to copy this base template to your theme and modify it for your theme specifically.

rhukster avatar Jul 15 '19 16:07 rhukster

It would really help if you included this explanation and maybe an example in the readme (here and on the login-plugin readme). Hiding the menu is a frequent question, usually with the login plugin. The solution is probably obvious to you but not so much for somebody who just started with grav and is checking whether grav will work with their requirements.

ilu33 avatar Jul 16 '19 14:07 ilu33

Could you maybe provide a screenshot of the error? I think you solution is the best one to come up with. However the fix should be placed in the theme, so instead of writing any explanation to fix a theme, you should rather do the fix to the learn2 theme. Simply copy the default template and apply the empty code.

NicoHood avatar Dec 10 '20 22:12 NicoHood

Editing the README.MD like this would help everyone:

If you don't want the menu to show up during maintenance you can remove it. In case of learn2 theme the code would be:

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

{% block sidebar %} {% endblock %}

{% block content %}


Depending on your theme you might need to copy and rename the theme's base template to a maintenance-specific version and hide some other menu elements there.

ilu33 avatar Dec 25 '20 19:12 ilu33

I cannot edit comments on github anymore. I used backticks instead of quotes, sorry about that.

ilu33 avatar Dec 25 '20 19:12 ilu33