0

I have a View with a Block display which shows 4 nodes of 1 type. I'd like to add node/xx/edit links to each node on the block. I've searched Google only to get confused more. Which hook to use? views_pre_execute, views_pre_render, views_pre_view .... And once you get the right hook, how do you actually add those links? Obviously I'd like to check the current user's node_access permissions too before adding those links.

This is Views 2 with Drupal 6.

4
  • are you using the views ui to create the view or is it done completely through program? Commented Jan 31, 2013 at 14:54
  • Used views_ui but the view will be exported via features module in the near future.
    – Beebee
    Commented Jan 31, 2013 at 14:55
  • there is a fields called node edit link have you tried that? Commented Jan 31, 2013 at 15:04
  • Thanks, I've tried it. It works. I'll accept as answer if you type it as answer. I'm still however quite interested how to do this kind of thing through coding and hooks.
    – Beebee
    Commented Jan 31, 2013 at 15:08

1 Answer 1

2

There is a field called Node :Edit link which can be added to the fields and it will give you the edit link. This also respects the permissions that is it would only be shown to those who have permission to edit a post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.