By robert774 on
i try to get fivestar widget. in node.tpl.php i can use $node->content['fivestar_widget']['#value'], how can i get this widget in nodes,views,blocks by php code ?, i tried node_load but it doesnt load fivestar_widget
i try to get fivestar widget. in node.tpl.php i can use $node->content['fivestar_widget']['#value'], how can i get this widget in nodes,views,blocks by php code ?, i tried node_load but it doesnt load fivestar_widget
Comments
Odd. node_load() should
Odd. node_load() should load the fivestar widget, but if it doesn't, you *can* display it programmatically. Look at the fivestar_widget_form() and fivestar_static() functions in the fivestar.module file.
As for Views, the fivestar module comes with views integration, so it should work.
- Corey
fivestar_widget_form() works
fivestar_widget_form() works great!!! tnx.
fivestar_widget_form() elaboration
I tried outputting the fivestar widget in a custom module as well by doing this but it didn't work:
To save someone some time, this is the exact code that should do it every time provided that you have the node id.
Hope the elaboration helps someone. Thank you all for pointing me in the right direction.