Contextual links backport - more or less

Drupal 7 now comes with the contextual module which makes it very easy to edit your site as there are inline action links available on your content, blocks and so on. There are a few modules out there available for D6 - block edit and admin:hover come to mind - which offer the same functionality but are different when it comes to interface and/or extendability.

We decided to write a new module from scratch with the UI in mind of the D7 version, also taking care of performance and the need for easy extendability including hooks (duh) and static actions which allows us to have a static variable during the page request which can collect stuff from all over the place. You can test it out at with demo/demo. Surf to the 'articles' page which has contextual links for views, nodes & blocks.

What happens next ?

  • I could contrib this back and ignore all other efforts out there.
  • Merge this with block edit (or another) but with another branch (and also another name).
  • Commit this as a complete new project but with a good comparison to other modules.
  • Simply do nothing, saves me another project I need to maintain .. :)

So, let me know what you think, add comments, mail or ping me on IRC if you want to have a talk about this.

Update 17/03: code is available at


Submitted by stijn on March 10, 2010 - 18:14

I'd definitely be interested in this module.

You could always put it up at Github without officially supporting it on d.o. User can download it if they like and others could fork the project to do whatever it is they want to do. This way the source and the effort is out there without you having to maintain a project.

Since this will be part of Drupal 7 anyway I don't see the need for a new project and you could easily get away with it being a proof of concept bridging the gap between Drupal 6 and 7.

Submitted by Damien McKenna on March 10, 2010 - 19:57

Have you attempted to reuse structures & naming conventions from the D7 functionality or is the UI all you've used? For real value, given there are so many similar modules already, you should try to keep it as close to a backport of D7's functionality as possible, which would make it easier for people to migrate their functionality to D7 when the time came.

Submitted by joshmiller on March 10, 2010 - 21:34

Excellent interface -- exactly what I need. If you do not post it as a Drupal module, then I will gladly support it on d.o for the remainder of D6 lifetime.


Submitted by Matt Petrowsky on March 11, 2010 - 00:57

Yeah, at least github it (and let me know). If you do put it up on d.o. and you want some exposure for it (always good motivation), I'll do a video article on it and we'll see how many installs it gets up to within a short period of time!

Submitted by sun on March 11, 2010 - 20:18

Note that

1) already contains "back-portish" code

2) there are still a couple of open bug reports for Contextual module - please help in fixing those before trying to work on a backport.


Submitted by Stephen Musgrave on May 1, 2010 - 00:12

Can you add some more instructions in the README file?

I see that I need to add another variable to my template files -- but what is that variable supposed to do?

So far I've added:

print $node_classes

to my node.tpl.php file. That did nothing.

I did a dms($node) and I don't see anything in there, either.

Submitted by eigentor on September 6, 2010 - 08:47

+1 for making a project out of this.
Not doing so is less work - understandable. Making a project is better for people who use it...

Submitted by LPCA on September 9, 2010 - 23:50

have no idea how to add the variables.

is it through the preprocess functions?
how? where?

please commit the code to a drupal project at with full instructions. i'm sure someone will want to maintain it

You are here