print widget AFTER node's body

jacopo3001 - April 18, 2009 - 19:42
Project:Vote Up/Down
Version:6.x-1.0-beta2
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:ingo86
Status:closed
Description

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!

#1

poloparis - April 19, 2009 - 18:05

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

#2

Flying Drupalist - May 6, 2009 - 23:21

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

#3

Flying Drupalist - May 6, 2009 - 23:24
Status:active» duplicate

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

Help would be appreciated!

#4

fmueller - June 21, 2009 - 15:20

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.

#5

Gyt - June 22, 2009 - 07:03

Use this function somewhere in node.tpl.php

<?php
print theme("vote_up_down_widget$style", $node->nid, 'node');
?>

or this in comment.tpl.php

<?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.

#6

poloparis - June 22, 2009 - 08:12

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 ?

#7

Gyt - June 22, 2009 - 08:23
Status:duplicate» needs review

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

<?php
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.

AttachmentSize
vote_up_down.patch 1.4 KB

#8

ingo86 - September 6, 2009 - 14:02
Assigned to:Anonymous» ingo86
Status:needs review» fixed

You can use the

vote_up_down_widget_form($node)

function on beta6.

#9

System Message - September 20, 2009 - 14:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.