How do you change the caption on a thickbox window to show the "title" of the image node, not the file name?

duran - January 6, 2009 - 16:03
Project:Thickbox
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

As the title says.
Currently the THICKBOX module shows the file name.
How can I change it so it shows the TITLE of the NODE, not the file name of the file attached to the node?

Thank you.

#1

frjo - January 7, 2009 - 00:39
Version:5.x-2.0» 5.x-1.x-dev
Component:User interface» Code

Please try out the 5-dev version of Thickbox and add this on line 204 in the file thickbox.module.

    // If the title is empty use alt or the node title in that order.
    if (empty($item['data']['title'])) {
      if (!empty($item['alt'])) {
        $item['title'] = $item['alt'];
      }
      else {
        $item['title'] = $node->title;
      }
    }

It is right before this line:

    if (strpos($formatter, 'thickbox][') !== FALSE) {

I have not tested this, it's a quick backport from the 6-dev version.

#2

duran - January 7, 2009 - 21:13

I'm not sure if it was clear in my OP, I apologize.
I'm using ... Thickbox 5.x-2.0

The only DEV branch I see for 5 is http://drupal.org/node/122466 which is a 5.1 dev...

Is that what you mean?

#3

frjo - January 8, 2009 - 06:57

Yes, that’s the one.

#4

duran - January 9, 2009 - 17:44

Removed the thick box, put in the dev version.
This did not help.

I'm still seeing the file name, not the node title.

#5

Blackguard - September 23, 2009 - 20:53
Version:5.x-1.x-dev» 6.x-1.x-dev

I'm having the same issue with Drupal 6.

 
 

Drupal is a registered trademark of Dries Buytaert.