I have a website where some pages are only viewable by organization members. Since I try to keep as much as possible public, these pages aren't grouped in a particular section. This module works great for preventing people without the right privs to view the pages. However, it also removes those pages from the menu (and submenutree). I understand that this makes them completely hidden for security, but in my case, people aren't generally going to be logged in so they don't know they're missing content on the site when they browse. So I have to explain to people that they need to sign in and then more content appears to them.
Is there a way to show the page's menu item even if they're not allowed to view the page? Then when someone not signed in clicks on it, they will get the usual access denied/sign in page and can sign in at that time. Or is there a different module I should use for this purpose?
Ideally, there would be some sort of tag on these menu items too so I could style them differently like a members only link.
Comments
Comment #1
gordon commentedThis was actually a bug in Drupal 5.x where nodes could not be accessed but menu items would remain visible.
In Drupal 6.x they redeveloped the menu system and part of this redevelopment was to fix this issue. This is something that is built into Drupal and simple access has not control over.
Comment #2
nzcodarnoc commentedOk - I get that it's by design. But is there a way to change the default behaviour?
I'm aware this might not be the best place to ask this question, but I am loath to cross post.
Comment #3
nzcodarnoc commentedI've answered my own question, http://drupal.org/project/restricted_content turned out to do what I wanted.
Comment #4
tingdongc commentedYou can also use node type template to control access, for example create a node-CONTENT_TYPE.tpl.php, print the $content only when logged in:
Of course you need to set in template.php to use this node-CONTENT_TYPE.tpl.php, which is very well documented.