Variable in theme to print the signatures? (automatic add set to off)
| Project: | Signatures for Forums |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Hi Liam -
In the settings it mentions switching off the "Automatically add signatures to content" setting so themers can position the signature in the template manually. After switching this setting off, I dug around trying variables and searching the issue queue as best I could but couldn't seem to find which variable to print in my node.tpl.php or comment.tpl.php in order to get the signatures to show up. Trying <?php print $signature ?> and other variations on the name didn't do the trick. I cleared my theme registry just to make sure that wasn't the cause. I could have sworn I read an issue (or forum post) where you talked about it, but can't seem to find it anymore. Tried reading the module's code but I'm not that good yet ;) I'm using core forum by the way (not AF).
Anyhow, if you could (when you have a moment) post the correct code to drop in my templates that'd be most excellent :D
Thanks in advance.
(my use for this in the theme will be a little "show original post" jQuery toggle widget at the top of forum sub-pages, and I am trying to get it so that nothing but the node body shows up)
- David

#1
Same here. I don't use advanced forum. I have core signatures enabled. I don't want my users to have pictures in the signatures (defoult input filter for al users uses bbcode img tags) so i installed this module to set some input filters just for the signature.
But it only works if i leave "Automatically add signatures to content" to ON. Then the signature is "attached" in the bottom of the comment.
But if i turn it off the signature is gone. If i input something under My account -> edit -> signature it doesn't show in my theme.
I use core template function in my comment.tpl.php layout:
<?php if ($signature): ?><?php print $signature ?>
<?php endif; ?>
So my question is. Does the "Signature for Forum" module work with core template function $signature if "Automatically add signatures to content" is set to OFF?
Thanks for replies!
#2
Unfortunately, there isn't a variable. I'll need to investigate what Advanced Forum does, then create something similar which doesn't conflict. In the meantime, just do this to print the signature in your theme:
<?phpprint signature_forum_get_signature($node);
?>
or if it's a comment:
<?phpprint signature_forum_get_signature($comment);
?>
#3
#4
Thanks Liam - in any case, works great for now :)
#5
Thanks i will try this weekend.
Edit: I tried quickly now and manually input the suggested code snippet in my comment.tpl.php and after quick test it works fine. I made custom filter for signatures that doesn't output nothing but links. I tried to set maximum number of lines to 3 and it works fine.
So now i don't have to worry about images in the signature any more. (i have bbcode module with image support so this was a big problem).
Great module!