23478 Posts in 18941 Topics by 2878 members
|Go to End|
30 October 2010 at 10:49am
I'm using <% Menu(level) %> to construct my menus. Some pages have restricted access, only logged users can access these.
But, the thing is, I still want those "logged-in users only" pages to appear in menus (if the user is not logged, the login form appears then he can access it).
Looking at the code, both "Children" and "Menu" methods filter those pages that can't be viewed. It may has some sense for some people, but for some others, everything an user "could" access should be included in menus (we don't want to hide what they can't reach).
I've fixed this issue by making a patch to core/model/hierachy.php file, but maybe there's another way without messing with the Sapphire code.
30 October 2010 at 12:36pm
You can use <% control AllChildren %> to get all the children (regardless of permissions), not sure if you can do AllMenu, I assume not.
Another way around it would make redirector pages to the hidden pages. Make the redirector pages public and in the top level menu. You will then have the problem of 2 links when they're logged in but another work around is to add a class (or hide) pages of type RedirectorPage when logged in.
|Go to Top|