Place CSS around closed event in Drupal's teaser
Grimlock - October 13, 2008 - 03:53
| Project: | Signup |
| Version: | 5.x-2.4 |
| Component: | Themeability |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hello,
Thanks for the great module! I was trying to figure out how to place a div around a node that has signups closed so that users won't have to click the node to find out if it was open for registration.
I used the following if condition in my node.tpl.php to achieve similar results using the protected module but since I'm not a programmer I couldn't figure out how to tell if the signup module's signup limit was hit.
Here's the code i use in my node.tpl.php
<?php if($node->is_protected) {
print "<div class=\"_lock\">This node is locked.</div>";}
else{ print "Open!";}
?>Thank you.

#1
a) I highly recommend using the devel module for figuring out stuff like this. If you enable that, and visit a signup-enabled node, you can use the "Dev load" tab and see all kinds of stuff about the $node object for the node you're viewing. Very helpful for stuff like this.
b) Even if you don't use devel, you can just do some debugging in your theme like so:
<?phpprint '<pre>' . var_export($node, TRUE) . '</pre>';
?>
To see everything in the $node object.
Either way, if you search the output, and perhaps experiment a bit with opening/closing signups, you'll discover a bunch of signup-related info lives in $node:
$node->signup$node->signup_status$node->signup_close_signup_limit$node->signup_total...
#2
Thanks a billion! Its funny I was thinking about installing the Devel module but I didn't know how it would apply, but thanks to you, you gave me a real world example. Thanks thanks thanks, I'm now off to the races with theme customization!
#3
Automatically closed -- issue fixed for two weeks with no activity.