Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar is still visible in maintenance mode #30

Open
ilu33 opened this issue Jul 11, 2019 · 6 comments
Open

Sidebar is still visible in maintenance mode #30

ilu33 opened this issue Jul 11, 2019 · 6 comments

Comments

@ilu33
Copy link

ilu33 commented Jul 11, 2019

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.

getgrav/grav-theme-learn2#82

@ilu33
Copy link
Author

ilu33 commented Jul 15, 2019

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.

@rhukster
Copy link
Member

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.

@ilu33
Copy link
Author

ilu33 commented Jul 16, 2019

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.

@NicoHood
Copy link
Contributor

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.

@ilu33
Copy link
Author

ilu33 commented Dec 25, 2020

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
Copy link
Author

ilu33 commented Dec 25, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants