Place CSS around protected node
Grimlock - October 8, 2008 - 05:53
| Project: | Protected node |
| Version: | 5.x-1.2 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
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

#1
Try this:
<?phpif($node->is_protected) {...}
?>
#2
Yes! This works thanks a million :)
#3
Thanks for using it! ;)
#4
Automatically closed -- issue fixed for two weeks with no activity.