Project:Protected node
Version:5.x-1.2
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

Try this:

<?php
if($node->is_protected) {...}
?>

#2

Yes! This works thanks a million :)

#3

Status:active» fixed

Thanks for using it! ;)

#4

Status:fixed» closed (fixed)

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