I followed the instructions on this issue:
#544354: How to display voting widget by API for nodes?
Sorry but thats nothing more than a clumsy workaround for not repating the widget in the node.
The thing is, i'm trying to print it in Advanced Forums posts, in which $content is nothing more than a string.
So i'm getting double widgets in every topic/comment because i cant unset the VUD widget.
What is the proper way for printing a widget without setting the node type in admin/settings/voteupdown (i'm figuring that to avoid double widgets thats the only way)?
Isn't there an API call for that?
Thank you very much for this great module, and for reading this.
Comments
Comment #1
marvil07 CreditAttribution: marvil07 commentedI think you want to read the
hook_nodeapi()
implementation on vud_node module.There, you can see the steps we follow in order to render the widget.
Please also note that now we support #582624: Expose widget to CCK fields reordering, so if you have CCK installed, you can just drag and drop the position.
Feel free to re-open if needed.
Comment #2
Fidelix CreditAttribution: Fidelix commentedThanks for answering.
I take that using hook_nodeapi() i can get a specific field from a specific node and print it. And thats great.
However, will i be able to actually delete it from $content?
I know that was covered before in #544354: How to display voting widget by API for nodes?, but i'm not being able to do that in Advanced Forums with Nodecomments.
I wont change the status of the issue because maybe hook_nodeapi() actually solves my problem.
Any tips will be highly appreciated.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedI'm having the same issue - because these are comments and not nodes, I don't have access to hook_nodeapi.
I can't figure out how to remove the widget from $content. How can I put the widget in a custom place on a comment?
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedAs per my post earlier today, I was able to see that in vud_comment_comment is where the widget is prepended to the comment content.
Because some developers have expressed an interest in customizing where the widgets are output in comments (in this issue and in http://drupal.org/node/544354), I'd like to suggest that whether the widget is output be made customizable (a simple yes/no checkbox in the configuration screen for Vote Up/Down Comments).
That way, developers who would like to place the widget wherever they'd like can disable the widget output in the configuration screen and use the theme('vud_widget'... function to place it wherever they'd like. The best way to do this right now is to change the vud_comment_comment function in this module, which would make it tougher to keep up with upgrades.
Are you willing to do this, or would you be willing to consider a patch if I were to create one?
Comment #5
marvil07 CreditAttribution: marvil07 commentedPlease do not hijack issues
See #791082: Let separate voting widget from $comment->comment for what you need. Probably that issue is going to be more generic to do that with vud_* submodules
Comment #6
marvil07 CreditAttribution: marvil07 commentedSince there are not follow ups by Fidelix, I am closing this issue, but feel free to reopen if someone share his concerns.