A number of the sites that we've been working with require large captions for image. A full example might be something like this:
Title of the Work
Artist Name
Acrylic on paper, mounted on linen. 9'3 1/4" x 10'3" (282.5 x 312.4 cm)
It would be great to be able to save these captions as the body of the image's node.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | image_attach_captions.patch | 2.13 KB | seanbfuller |
Comments
Comment #1
seanbfuller commentedHere's a first pass at bringing this feature in image_attach. Currently it is using the parent node's filter setting, which is probably wrong.
Comment #2
drewish commentedinteresting... i think it'd be better to use the teaser though...
Comment #3
erwinova commentedThe code not warking... may be the problem at line:
'$output .= '
-caption">'. check_markup($image->body, $node->format) .''."\n"; '
need help...
Comment #4
Hetta commentedFrom 2006, for 6.x, with "code needs review", and a "not working" in September.
Moved to 5.x-2.x, with "code needs work".
Comment #5
Hetta commentedmarked http://drupal.org/node/228150 as duplicate
Comment #6
iantresman commentedI've made an Image module feature requested, and described a hack, that displays an image node's body text, as the image caption (but not in teasers), described here.
Comment #7
ericjam commentedPlease implement this in a future update!!! Image Caption module requires you to add a caption class but doesn't allow you to specify WHICH size will receive the caption. Think improved automation for Image Attach.
Comment #8
joachim commentedI'm not sure about this one.
It's a nice feature, but it's too much for many uses. So we need another setting, definitely.
I wonder whether it would be doable as another module with hook_form_alter -- but then there's the theming to consider.
At any rate, would need to be implemented for 6 first and then backported.
Comment #9
iantresman commentedI think many users would like to add a caption to their images, if the option were available. My hack mentioned above adds this feature, so it should be possible to put a kosher version of it into D6, together with an option to toggle the feature (which I couldn't figure out how to do).
Comment #10
ericjam commentediantresman your hack does not specify which node will receive the caption, i don't want captions in my teasers! just the full node view
Comment #11
iantresman commentedMy hack displays the text from the image node, as a caption in only the full node.
You can see it in operation on this adult site, in the section "Prudery, superstition, and the Law (NSFW)", where you can see that none of the teaser images show a caption. But click on an entry with an image, to see that a caption appears beneath the image. Click the image, and a Lightbox2 pop-up appears (also containing the caption text, details). Click the link "View Image Details" to go to the image node, where the caption text is edited.
Comment #12
ericjam commentedOkay I hacked your hack and found the solution for my needs.
I just want to use the TITLE of the Node (Image) as the caption shown
Go to the bottom of your image_attach.module
function theme_image_attach_body($node) {Put this right below image_display
Style in CSS as you like!
Comment #13
joachim commentedThere is no need to hack the module to make changes to theme functions -- the whole point of the theme layer is that you can override these in your theme.
Comment #14
tdivito commentedIn the 6.x-1.0-beta6 release (or maybe sometime before), there were some changes to some of the functions that broke a few of the other already published caption functions for image-attach. Here is the function I added in my template.php file. Hope it can help someone.
Comment #15
joachim commentedYou really shouldn't be using node_teaser() on every page view -- it's meant only to be used when you save a node. Retrieve the stored teaser from the $image node.