Drupal - Image Field Caption
In Drupal 7, an image field comes with alt and title fields for your content type's image(s). The Image Field Caption module adds an extra text area to enter caption text or html for image field descriptions.
Now when our image is displayed, we have our custom caption text, and we maintain accessibility with the alt and title attributes.
To customize how the caption is displayed, we can make a copy of the image_field_caption.tpl.php file and place it in our theme's directory, for example:
Now we can modify the html to meet our needs:
<?php /** * $image - contains the image html rendered by Drupal * $caption - contains the image field caption string */ ?> <?php print $image; ?> <blockquote class"image_field_caption"> <?php print $caption; ?> </blockquote>