I have a custom node type I have created which is being displayed in a block.

The node title is showing as a link which is exactly what I am wanting, however I would like to display a tooltip consisting of one of the database fields, which in this case is a short description of a product, when hovering over the link in this certain block. I am having a little trouble acomplishing it though as the tooltip I am displaying is being generated in javascript. I have tried using the script to display the database field for the content however having this php data in the javascript is proving to be a pain, so I was thinking there must be something using the drupal api.

I have found some patches to set a link title consisting of node content for various modules, but am having a little trouble seeing where I would do this and have never done any hooking before...

I have been reading the handbooks for a while, and searching all over the drupal site / forums and havent been able to find what I am looking for.

Has anybody done this themselves?

Or can someone point me in the right direction?

Thanks,

GT

Comments

nedjo’s picture

Probably your links are generated by calling the l() function. You need to include a third argument in the call, with the value array('title' => $tooltip_text).

goldentoque’s picture

Does anyone have some example code which would illustrate this?

Thanks,

GT