I can make the image map work on an image embedded in the body of any node because I can insert the class in each individual case. But on an image node itself I don't have access to the image tag.
I haven't worked out how to theme the image tag in template.php. If I add jq_maphilight to the image.module function image_display(&$node, $label = IMAGE_PREVIEW, $attributes = array()) (very bad boy) it works OK but I get an error "no usemap" for all image nodes where I don't provide an image map. Any assistance please?
Comments
Comment #1
grahamshepherd commentedIn image.module 5.x-2.0-alpha3 I modified the function as shown below adding jq_maphilight in the class and usemap as an attribute. The map works and the error I mentioned above disappears. However, I know that this is entirely unmanageable. How can I modify template.php to achieve the same end? This is not a "theme" function.
I am upgrading the site to D6 shortly and would like a solution. Any asistance would be appreciated.
Comment #2
WorldFallz commentedI don't have the image module installed anywhere accessible to try this out atm, but it has a 'theme_image_display' function-- that is what you use to override the image_display function "properly" (ie without altering any core files):
Place this code in the template.php file, change the "theme" part of the function name to the name of your theme (ie "garland_image_display"), and make your changes there. If I get a chance to try this out I'll post back.
Comment #3
grahamshepherd commentedMany thanks for the clues. I added the following to template.php and it works without modifying image.module:
It might be worth adding something to this effect in README.txt
Comment #4
WorldFallz commentedThanks for posting back. Good idea about updating the README.txt file-- will do.