Add Plus1 Voting Widget to Nodes in Panels
If you're using Panels to output your content type and you enable the Plus 1 module, you may notice the Plus 1 widget doesn't appear when you view your node.
If you don't see the widget, then you've probably enabled 'no extras' in your Panels node template override. If there's no other reason for enabling this option, you can simply uncheck the box and the Plus 1 widget will appear when you view your node.
If you do need to keep this unchecked, you can add a snippet to either your theme's node.tpl.php or node-customtype.tpl.php.
<?php
if (module_exists('plus1')) {
if (in_array($node->type, variable_get('plus1_nodetypes', NULL))) {
if ($page && variable_get('plus1_in_full_view', 1)) {
print plus1_jquery_widget($node, $teaser, $page);
}
}
}
?>
Comments
The following line is not so useful, if you don't want a double plus1-widget... But without that line it works perfect. Thanks a lot!
if ($page && variable_get('plus1_in_full_view', 1)) {
Add New Comment