Hi all, I’m new to Grav and I love it (a blessing compared to WP). I still have a lot to learn and to experiment, now I have a question about the menu (using Antimatter)
I’ve managed to create a protected page (and subpage), the visitor has to login to view them (so far so good). The title of this protected page (and subpage) appears in the menu, even if the visitor is not logged in.
Is it possible to (automatically) hide these pages from the menu until the visitor has logged in?
Currently this is not something the login plugin provides. It assumes the page is visible, you can navigate there, but are prompted to login if you don’t have access.
Hiding the menu can be done by performing the logic in the theme’s twig template that outputs the menu. Basically you would have to ensure the current logged in user (grav.user
) has access that matches the page.header.access
for the page as you build the menu.
The better solution would be if the login plugin has an option to do this. I’ve created an issue there for a future improvement: https://github.com/getgrav/grav-plugin-login/issues/87
Great! I hope the Admin Pro plugin is progressing (https://getgrav.org/blog/plans-for-2016)
I’d be willing to pay for such a plugin if it could handle such things natively