Closed (fixed)
Project:
Vote Up/Down
Version:
5.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Dec 2008 at 20:09 UTC
Updated:
3 Mar 2009 at 22:44 UTC
So I've added
print $vote_up_down_widget
to my node.tpl.php and it works great. The problem is that when I am in the admin section of my site and I select which content types I want to allow voting on, the site just ignores these settings and displays the widget anyways.. How do I resolve this issue?
Comments
Comment #1
davedg629 commentedYou have added "print $vote_up_down_widget" to node.tpl.php. Node.tpl.php will control what is displayed for every node on your website, it doesn't matter that you change the settings and displays for the widget on the admin pages. You need to create a new tpl.php file for the node type you want the widget to display on.
Lets say you want the widget to display on the content type "blog". You would create a new file called node-blog.tpl.php and copy the contents of node.tpl.php into it. Then add your "print $vote_up_down_widget" where you want it in the node-blog.tpl.php file and delete the line from the node.tpl.php file. Hope that helps, later.
Dave
Comment #2
davedg629 commentedI am having my own problem with the display of this widget. I am using the alternative (up only) vote widget. I do not want the widget to be displayed in the "content" of the node so I have decided to add "print $vote_up_down_widget" to the template file for the node type. My node type is "goal" and the file is named node-goal.tpl.php. Here is the part of the file where I inserted the widget:
The widget is not displaying though. I don't know why, it seems like everyone else has got this to work. Thanks for any help.
Comment #3
davedg629 commentedAlright I was not including the template file code into my themes template file. Included it and it worked.