Lullabot Ideas

We know stuff. We empower you to know stuff too.

Module Monday: Custom Contextual Links

Article by Jeff Eaton

With Drupal 7's contextual menus, it's easy to pull up edit forms and other management screens for specific entities like nodes, comments, and views. Just mouse over the entity in a list, and you'll get a dropdown menu of contextual options. Adding your own custom links to an entity's context menus, however, can't be done out-of-the-box. Custom Contextual Links changes that; it allows you to add any link to the context drop-down for supported entity types!

Screenshot of the Custom Contextual Links administration screen

Setting up Custom Contextual Links is easy. The module adds its own screen to the administrative configuration section. Adding a new link gives you a set of simple options to control the link's title, destination URL, and where it should appear. For now, it supports adding links to specific blocks, all blocks, specific nodes, specific node types, and all nodes simultaneously. It's a little detail, but the module's administration UI does a good job of hiding unnecessary options using Drupal 7's new States API.

Screenshot of the contextual link in action

Once the link is set up, everything is ready. Jump back to a page that features the node or the block in question, mouse over it, and you'll see the new option in its contextual dropdown menu. Custom Contextual Links is a relatively new module; it was released less than a week ago, but it's stable and easy to use. It's a great tool to streamline the administrative and editorial navigation process!

Comments

Awesome Module

Thanks for sharing this module. It was an idea in my head, that Ben (bkoether) brought to reality. Great work.

YES!!

You don't even want to know the hackneyed work around I have been using to provide this functionality.

Gorgeous

Gorgeous module. Trying it out right away.

Grate usefull module!

Grate usefull module!

Never seen

I found this informative and interesting blog so i think so its very useful and knowledge able