Is there a way to add image captions to the images in the 'Image' field of the Articles content type? I just want the captions to appear on the article teasers and full articles.
I'm looking into this now and their appears to be a fairly simple solution, so I'll keep you posted. Just to clarify, you'd want the caption to appear below the image?
Yes, I would like them to appear below images, and if possible, if the caption is too long it either cuts it off to a certain number of characters or the text is wrapped to the next line. Thanks for the quick response.
Alright, I think I have a solution for this. Download and rename the attached file to content-field.tpl.php and move it into the theme's root directory with all the other tpl files.
Next, navigate to Administer » Content management » Article and click to manage the fields. Once you're on the fields screen, locate the Image field and click the 'configure' link to its right. Scroll down to the bottom of the page and the last option should be 'Description field' which you'll want to enable and then save.
Next, copy the CSS from the attached txt file (caption.txt) into the stylesheet you're using (style1.css, or whichever). I've added a couple of styles to the caption, but you can change them around. If you don't want to display the caption on the teaser, just add 'display:none'.
Now when you add and image or edit an article there should be a description field next to the thumbnail of the uploaded image which will display on the node.
| Attachment | Size |
|---|---|
| content-field.tpl_.php.txt | 1.81 KB |
| caption.txt | 227 bytes |
Thanks Rob,
This worked great. I twicked the CSS a little to fit how I wanted it to appear, and this is now working just like I wanted it to.




