[development] hook_link - proposal

Just Justin rocketfuel at spaceship.com
Wed May 10 22:39:53 UTC 2006


Greetings!

I'm a fairly new drupal hacker and I must say that for the most part 
it's been a great experience working with drupal.

However, I think hook_link() could really be improved.


The problem:

Any and all modules can add to $links, which is great.  The issue I have
is twofold:

  1). The links that are added are generally HTML (presentation) rather than straight data.
  2). All links are folded into a non-keyed array, so the themes have no idea which links came from which modules.

It would be great if instead of this:

  $links[] = l(t('read more'), "node/$node->nid", array('title' => t('Read the rest of this posting.'), 'class' => 'read-more'));

Modules were doing something like this:

   $links['mymodule'] = array('title' =>  t('Read the rest of this posting.'), 'url' => "node/$node->nid", 'class' => 'read-more');

And relying on the themes to actually display the link.



I'd be happy to help code/patch this up, but I wanted to bounce the idea off of some of you first to get things rolling.
It looks like I'm going to need something like this sooner rather than later, but I'd like to at least be hacking the
core in such a way that my changes could eventually make it into a release, if this is deemed to be a good path to take.


Regards,

Justin aka {datura} on irc.
















More information about the development mailing list