in node view, vote widget is printed as part of $content, before the node's body.

how can i control this?
i would like to be printed after the node, more compatible with my desired layout..?
thanks!

CommentFileSizeAuthor
#7 vote_up_down.patch1.4 KBGyt

Comments

poloparis’s picture

From the package's README file :

Theme story links:
-----------------
If you use a PHPTemplate theme you can theme story links nodes with a
"node-storylink.tpl.php" file.

An example "node-storylink.tpl.php" and "template.php" is included.
Place them in the folder of your theme. The examples are styled with the
css file "vote_up_down.css" in the vote_up_down module folder.

in the node-storylink.tpl.php you'll notice that you can control where the voting widget can be displayed relative to content.

Play with that and let us know what you have come up with.

cheers

Flying Drupalist’s picture

It doesn't work. There are no widgets displayed.

Flying Drupalist’s picture

Status: Active » Closed (duplicate)

I assume this is because of this:
http://drupal.org/node/447374

Help would be appreciated!

fmueller’s picture

Open the file vote_up_down.module and find the function vote_up_down_nodeapi(). In that function there are two places where a weight is set to -10. Increase that value. Change it to 10 for example. This should place the vote up down widget below the text of the node. Probably this solves your problem.

Gyt’s picture

Use this function somewhere in node.tpl.php
print theme("vote_up_down_widget$style", $node->nid, 'node');

or this in comment.tpl.php
print theme("vote_up_down_widget$style", $comment->cid, 'comment');

Turn off "Vote widget display..." in "admin/settings/vote_up_down" to avoid getting double voting widgets.

poloparis’s picture

re #4 : I read all the time that you're not supposed to hack module functions within the modules themselves. So when you do that, how are you supposed to do it ? Can you copy the entire function, modify it and paste it into the template.php or some other place ?

Gyt’s picture

Status: Closed (duplicate) » Needs review
StatusFileSize
new1.4 KB

OK. I have a good solution. If you use this patch, variables $vote_up_down_widget and $vote_up_down_points are available. Then use

if ($vote_up_down_widget) { print $vote_up_down_widget; } 

in node(comment).tpl.php

It's not a hack, but changes in template.php not necessary.

ingo86’s picture

Assigned: Unassigned » ingo86
Status: Needs review » Fixed

You can use the

vote_up_down_widget_form($node)

function on beta6.

Status: Fixed » Closed (fixed)

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