Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Hide Menus on Protected Pages

Started by Muut Archive 10 years ago · 2 replies · 701 views
10 years ago

Hi,
I am just getting started with Grav and I am trying to password protect my whole site. I have been playing around with the private plugin (preferred, don't need different users) as well as the admin plugin. Pages are protected as expected, but the header and menu structure are still visible - this was the same for the antimatter and the learn2 theme. Is there an easy way to hide menus and/or just display the login window?
Thanks so much!

10 years ago

Is there a reason you don't just use basic auth? If you don't need interactive registration and such, and you just want to wall off the entire site, it's the simplest and most standards compliant way to do it.

10 years ago

Easiest thing is to edit the theme's base twig and wrap the menu in a {% if grav.user.username %} check.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2947 9 years ago
Archive · by Muut Archive, 9 years ago
3 1118 9 years ago