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
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

tolmi - October 8, 2008 - 07:52

Try this:

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

#2

Grimlock - October 8, 2008 - 19:51

Yes! This works thanks a million :)

#3

tolmi - October 8, 2008 - 19:52
Status:active» fixed

Thanks for using it! ;)

#4

Anonymous (not verified) - October 22, 2008 - 19:54
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.