I realize I could override this with a theme function, but it seems an unexpected result to me that if I hard-set an alt tag when calling 'image_display' it will not override the default setting of $node->title.

ie, theme_image_display would behave as I expected if it looked like this:

return '<img src="'. check_url($url) .'"'.!empty($attributes['alt'])?'':'alt="'. check_plain($node->title).'"') .!empty($attributes['title'])?'':'title="'. check_plain($node->title).'"'). drupal_attributes($attributes) .' />';

i guess that could get a little out of control, particularly if applied to the src attrib, but .....

reason being is that FF goes with the first ALT tag it sees, making my $attributes passed alt tag invisible.

CommentFileSizeAuthor
#3 image_153136.patch715 bytesdrewish

Comments

drewish’s picture

could you roll a patch? it'd make it a lot easier to see exactly what'd need to change.

and i'm wondering why we're not calling theme_image there...

ragaskar’s picture

yeah, as soon as i get a chance i will submit a patch .. having a client meet thursday, so it might be a week or so. sorry.

drewish’s picture

Status: Active » Fixed
StatusFileSize
new715 bytes

okay so after looking at this. the correct way for you to set your own title is to add your own theme function for theme_image_display() and just add your own title there.

i'm committing the attached patch which uses theme_image to build the img element.

ragaskar’s picture

cool! that looks like it'll do it for me! Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)