By monkfish4d on
Hello,
In a tpl file I've found this code
print $node->field_image_cache[0]['view']
which outputs the following HMTL...
<a href="http://www.spinninghat.com/sites/default/files/product_images/Util-Key 01.JPG" title="" class="thickbox" rel="gallery-31"><img src="http://www.spinninghat.com/sites/default/files/imagecache/uc_main_image/product_images/Util-Key 01.JPG" alt="" />
What I'd like to do is add a class attribute to the IMG tag, what is the best/standard way to achieve this?
n.b. I'm still fairly new to Drupal and have had another developer help me put a site together and I'm trying to clean up the edges now :)
Cheers,
Nick
Edited by WorldFall: added code tags.
Comments
print_r
print $node->field_image_cache[0]['view'] is the preformatted image tag
if you add
print_r($node);to your tpl file to see the content of the node, there will be a value (somewhere close to $node->field_image_cache[0]['view'], like $node->field_image_cache[0]['value'] )that you can use in your template as follows: