Set permission to view an item's existence, but not its content

Post

Posted
Rating:
#3717 (In Topic #741)
Greetings,

My website has a main_news block on the front page, and I've got a news category which consists of private content for a specific usergroup. I've set the category so that guests and members don't have view access, while the proper usergroup does, which works as expected. However, guests and members do not see the entry in the main_news block on the homepage.

I understand that this is expected behavior, as you normally don't want to offer a link to content that someone doesn't have permission to view, but in this case I'd like the restricted links to be visible in order to encourage people to sign up for the usergroup which does have permission. What would be the best way to accomplish this?

Post

Posted
Rating:
Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 Item has a rating of 5 (Liked by jacobgkau)
#3718
Hi,

You'd need to alter the code in sources/blocks/main_news.php. Change has_category_access to true || has_category_access at both occurrences.

Post

Posted
Rating:
#3722
Perfect, thank you!
1 guest and 0 members have recently viewed this.