Hello,

I'm trying to put a DIV and a class around the protected node when it is viewable anywhere in Drupal i.e. in the search results or when a protected node is in preview mode via a taxonomy. Putting a class around the protected node will increase the usability of this great module so that users who stumble upon the protected node will know the node is password protected.

I was thinking I would place the Div and class in node.tpl.php somewhere or would it go into the module itself? I'm a theme designer not a programmer so forgive my lack of knowledge.

I tried to put the below code in my node.tpl.php but it didn't work.

<?php if($node->protected_node) {
print "<div class=\"teaser_lock\">Hello, This Node is protected!</div>";}?>

Thank you

Comments

mtolmacs’s picture

Try this:

if($node->is_protected) {...}
Grimlock’s picture

Yes! This works thanks a million :)

mtolmacs’s picture

Status: Active » Fixed

Thanks for using it! ;)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.