I want to display a link on a node view page just like the "Add new comment" link. How should I do this?
I think it can be done through hook_node_view()
, but how can I use this hook?
I want to display a link on a node view page just like the "Add new comment" link. How should I do this?
I think it can be done through hook_node_view()
, but how can I use this hook?
In your implementation of hook_node_view(), add an element to the $node->content
array. The element should be a renderable array as expected by drupal_render().
In drupal6, you could implement the hook_links (just like the node module does http://api.drupal.org/api/drupal/modules--node--node.module/function/node_link/6)
Use hook_node_view
and add new variable $node->my_link
, add template file page--my_node.tpl.php and place that link wherever you want. This is solution for dynamic link for every node.
If you just want to add some no-dynamic link to your node_type than just add it in template file.