Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a site user who likes to size the image she uploads with the IMCE interface. Unfortunately, when she uses the caption module it adds the caption, but strips out the inline style from IMCE. Any suggestions?
Comments
Comment #1
iantresman CreditAttribution: iantresman commentedYes, I'm getting the same. I've used IMCE to upload a large image, and then resized it in IMCE (by setting new width and height dimensions) to thumbnail size.
After I add the blank CSS class, .caption{}, add some title text, and the "caption" class, the caption displays, but the uploaded image displays full size, and by specified thumb size is ignored.
Comment #2
iantresman CreditAttribution: iantresman commentedFurther to my comment above, the width and height attributes added by IMCE still appear in the source code, so Image caption must override them.
It seems that the workaround is to create and define a new class, eg. width128 (I use CSS injector to insert new CSS), and create img.width128 {width:128px}, and this almost works, but doesn't set aside sufficient space for the caption, so some extra CSS is required.
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedplus 1 (there should be a watcher module on d.0! instead of having to +1 every single post ...)
Comment #4
Anonymous (not verified) CreditAttribution: Anonymous commentedok .. so .. if you add in your css
.caption{
width:100%;
height:100%;
}
then it works out fine ..hope this helps
post script - not sure how you all are getting the "caption" class in IMCE but i edited the image.js ->common.cssClass,'default':'caption'
I dont think this is best practice though. how are you all doing it? Cause there was no chance I was going to let the user add caption everytime they wanted a caption.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commented