Want to create a link "Click Here To..." that will call a function in a module.

What is the best way to achieve that?


1 Answer 1


There is more than one way to skin a drupal. What is "best" depends heavily on the situation, but here are a few options. Is this drupal 8 or drupal 7?

Use rules instead of functions, and the Rules Link module.

Use a hook_menu to make a menu_local_tasks (a.k.a. tab) and style it how you want.

Look at the print module for inspiration and use a hook_node_view to add to the node's normal link set, where print adds it's print links.

As I have said on the irc many times, give more context information to get a better answer.

  • Thanks here is some more input - I am using the LinkedIn module and want to call the linkedin_access_token when someone is on a specific but dynamic page (ud/%uid) and clicks on a link that says Authorize.
    – GreenLion
    Feb 4, 2016 at 16:21

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