I want to show contextual links having Edit and delete links for each node on hover on main listing page of my application. I have searched and found the following code
function MyModule_node_view_alter(&$build) { if(isset($build['#node'])) { $node = $build['#node']; if(!empty($node->nid)) { $build['#contextual_links']['node'] = array('node', array($node->nid)); } } } But this code displays contextual link on node detail page. For example when individual node is visited like http://www.example.com/node/21. But I want to show these contextual link on listing page where all nodes are displayed. When I hover the node, this should be shown.
This is how my view settings looks like

Any help?
