What I would like to accomplish is the following:

When a list of a certain content type is displayed, I would like an "edit" link to be placed at the end of the summary text that, when clicked, would take the user to the node edit page for that particular node.

This list would either be created using the Views module, or through a taxonomy. That part isn't important.

How can I do this through custom module code? I'm trying to learn more about writing modules on my own, and would prefer to avoid using an already built module in this particular case, since I will already be creating the content type in question through a module anyway.

Would I do this through module code, or through theme code?

1 Answer 1


The best example of this I can think of is the Read More module which adds a "read more" link to the end of the body teaser (in teaser mode obviously).

The idea is to use the node view hooks and teaser build mode to target what and when you want to edit.

For Drupal 7 you can look at the read_more module source for an example.
For Drupal 6 you can look at the ed_readmore module source for an example.

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.