Closed (fixed)
Project:
Vote Up/Down
Version:
6.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
9 Aug 2009 at 18:47 UTC
Updated:
18 Jun 2015 at 03:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ingo86 commentedThere wasn't. In your version there's no way to do that, you should download vote up down 6.x-1.0-beta6.
Now you can display your widget easily calling vote_up_down_widget_form($node).
Feel free to open this issue again if you need additional help.
Comment #2
Anonymous (not verified) commentedcool, thanks for letting me know, can't wait to try.
Comment #3
Anonymous (not verified) commentedi have seen now it even supports views. nice job.
Comment #5
tormu commentedHmm - I tried that and it doesn't work when I have the alternative +1 style enabled. The function vote_up_down_widget_form() seems to have a line $style = variable_get('vote_up_down_widget_style_node', 0) == 1 ? 'alt' : '';
BUT I think it should be '_alt' instead of 'alt' in order for the $return = theme("vote_up_down_widget$style", $node->nid, 'node'); to work.
It's the same way in -dev version, too.
EDIT: ok, duplicate of http://drupal.org/node/416308
Comment #6
ManyNancy commentedAnyone know how to do this in 2.x?
Comment #7
dgastudio commented+1
Comment #8
zmove commented+1 for the 2.x version. I don't find an easy and quick equivalent of vote_up_down_widget_form($node)...
Shame, user karma only works with the 2.x version of this module, so I can't change.
Comment #9
dgastudio commentedsolved via contemplate...
Comment #10
Moscow commentedI also wonder how to move the widget beneath the node content for 6.x-2.x-dev. Have searched heavily, but found nothing.
Comment #11
dgastudio commented<?php print $node->content['vud_node_widget_display']['#value'] ?>Comment #12
Moscow commentedThanks, kervi
one problem solved - the widget showed up. But a couple of new appeared. I added this code to my node-review.tpl.php
print $contentprint 'Share some respect with the user if the post was helpful: '. $node->content['vud_node_widget_display']['#value']1) It seems it is not possible to switch off the display of the main widget via admin interface. So now I have 2 widgets of course.
2) when I add a vote +1 is added up to the "main" widget, but the one I added still shows "0".
Any ideas?
ps. the vote count in the newly added widget adds up only upon page refresh.
pps. I did not find how to hide the widget on anonimous posts. Shall I use tpl.php file for this or is there a better way?
Comment #13
dgastudio commented1. try to display everything as custom cck field: for example to print body:
print $node->content['body']['#value']2. look 1. :)
Comment #14
off commentedAnd how to display widget for comment?
Comment #15
marvil07 commentedYep, vud widget is shown on node template as part of
$contentvariable.So, if you want to custom how and where to show the widget, you need to render manually each part of the standard node
$contentvariable (fields, body, etc)So probably you want to:
Comment #17
meustrus commentedThat works great for nodes, but there is no such simple fix in comments.
Comment #18
meustrus commentedCan I please get a solution for comments? This is kind of important for my theme. An alternative (which would be better for nodes too) is if the "votes" hook in the vud theme could display the whole widget in the links.
Comment #19
marvil07 commentedplease open a new issue for comments. I think I going to maintain a handbook or include this as part of the README.txt FAQ section since many people ask it.
Comment #20
ndwilliams3 commentedThis is a good fix for a simple content type, but what about when you have numerous content types and numerous fields. It could be quite consuming setting up the node templates. I like the idea of including in the $links.
Comment #21
dreamdust commentedI've posted a patch for 6.x-2.1 that allows you to choose whether to display the voting widget in comment body or links. See: #791082: Let separate voting widget from $comment->comment
Comment #22
dreamdust commentedAlso, here is a patch (6.x-2.1) for nodes as well, which enables the user to choose whether to display the voting widget in node content or links.
This is a cleaner solution because it keeps logic out of the templates.
Comment #24
ManyNancy commentedYep +1 on $links
Comment #25
dreamdust commentedThis is an updated patch, for both nodes and comments.
This patch creates the option for users to choose whether to display the voting widget in node/comment content or links. It also adds a new permission for vud_comments 'view votes on comments' that allows you to separately control the display of widget or vote total.
This is tested against the latest 6.x-2.x-dev snapshot. If it works it's ready to be ported and included in the 6.x-2.2 release.
Note: For separate control of the widget and votes display, your widget should be configured to use a separate template for votes and widget in your widget.inc file:
Comment #26
dreamdust commentedSORRY disregard that last patch, it's backwards. I accidentally reversed the original and patched versions.
Comment #28
dreamdust commentedHere's the latest patch. To re-cap what this patch does:
Tested on my 6.19 install. If others can test and confirm let's get this added into the next 6.x-2.x release. I'll also port it to 6.x-3.x if all goes well.
Comment #29
marvil07 commentedplease do not hijack the issues, thanks for the patches, but this issue was a support request, not a feature one.
Comment #30
ManyNancy commented@dreamdust ehrm, please create a new issue. I would really like to see your patch in the module. Thanks.