It is often useful to add a "edit this node" or "edit this block" if a site editor is viewing content on a page that is not the node page itself. This includings viewing content from a "view" page where the normal edit tabs are not present for nodes or blocks.
Add the snippet to the template page for the content type. ie node-TYPE.tpl.php
Replace:
TYPE with the machine readable name of the content type.
TODO: ADD RELEVANT CONTENT TYPE with machine readable name of the content type.
if (user_access('edit any TODO: ADD RELEVANT CONTENT TYPE')) { print l('Edit this', 'node/'.$node->nid.'/edit'); }
Does Drupal development make your head explode and drive you crazy?
Why not learn from someone who has paved the way instead?
Sign up to my upcoming learning series.
I am Blair Wadman and this is where I write about Drupal, PHP, CSS etc
© Blair Wadman
2005 - 2011
Nice one, very handy!
Post new comment