Insert access denied message for anonymous users of Drupal site
I have a members only site where I'm using the Content Access module to restrict access to content开发者_开发技巧 for members. Some of my pages are views of the restricted content. The problem is when an anonymous user looks at the view they just get a blank page. Would it be possible to insert a message saying "Access Denied" or to redirect them (and not the members) to a membership page?
I don't want to restrict the view because I want to show anonymous users the page is there, but just not give them access - it is an incentive to join!
I had a similar issue for users of a site that I maintain, the clients wanted to still show the content in the menu and search results etc, and provide links to login/register etc when viewing the restricted node
I used the http://drupal.org/project/restricted_content module. This module lets you customise a message to display to end users.
For an example see http://www.eyeopener.co.nz/tutorials/win-uoa-optometry-ball-tickets-question1
For views I would recommend providing a short teaser to the end user, and when they click through to the node, ask them to login/register
精彩评论