I need to be able to display my contextual links in the node full content view mode. How can I achieve this? Maybe something in my node.tpl?
1 Answer
if you want to show contextual link on a node view try out this code on your custom module file.
function mymodulename_node_view_alter(&$build) {
$node = $build['#node'];
if (!empty($node->nid)) {
$build['#contextual_links']['node'] = array('node', array($node->nid));
}
}
-
Anyway of printing this in the tpl without having to make and enable a simple module to achieve this? Commented Jun 7, 2013 at 20:40
-
drupal.org/node/951088#comment-4350170 worked for me with few css changes to make the link display as block on mouse hover.the code needs to be placed at template.php of your theme– arpitrCommented Jun 7, 2013 at 21:15