Drupal - display an edit link, if the user if allowed to see it

/ Published in: Other
Save to your folder(s)

Copy this code and paste it in your HTML
  1. <?php if (user_access('administer nodes')): ?>
  2. <a href="<?php print '?q=node/'.$node->nid ?>/edit" title="<?php print t('Edit') ?>">edit</a>
  3. <?php endif; ?>

URL: http://daipratt.co.uk

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.