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.
Image field widgets' text data have inconsistent layout in the node edit form when there are multiple images on a node. The attached patch makes the alignment consistent and also allows the description text to wrap on to multiple lines. See the before and after screenshots.
Loosely related to #913846: Image/file field breaks after uploading two files.
Comment | File | Size | Author |
---|---|---|---|
#18 | Screenshot from 2021-04-19 17-39-41.png | 110.79 KB | vikashsoni |
#8 | image.css_4.patch | 1.15 KB | jessebeach |
#6 | image.css_3.patch | 1.07 KB | jessebeach |
#5 | image.css_2.patch | 740 bytes | jessebeach |
#1 | Re-ordered asterisk.png | 171.78 KB | Bevan |
Comments
Comment #1
Bevan CreditAttribution: Bevan commentedA related issue is that when a field/row is re-ordered, the asterisk appears on a new line below the widget data, as per the attached screenshot. A fix for this is probably out of scope of this issue for several reasons;
Comment #2
Bevan CreditAttribution: Bevan commentedBump! It would be nice to get this in before it's too late. The patch still applies cleanly.
Comment #3
effulgentsia CreditAttribution: effulgentsia commentedSubscribe. Screenshots look good to me. I'll see if I can get someone proficient with CSS to review.
Comment #4
yched CreditAttribution: yched commentedWon't work :(
The image style used to display thumbnails is configurable as a 'widget setting' for image fields.
100px works for the current definition of the 'thumbnail' image style as defined by the default install profile, but this cannot be used as a hardcoded value in a CSS rule.
Comment #5
jessebeach CreditAttribution: jessebeach commentedIn a future release of Drupal, this structure ( image + text ) should be rolled up into a class, not redefined for every instance. Nicole Sullivan calls this a media object (.media)
http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hu...
I added overflow:hidden to .image-widget-data and removed the float. Changed padding to margin on the image and removed the bottom value. white-space:normal was a necessary addition by @Bevan to override a system default.
I also updated the rtl css file.
Tested in IE6 (XP), IE7/IE8 (Windows 7), FF 3.6/Safari 5/Chrome 6 (MacOSx) in both ltr and rtl.
Comment #6
jessebeach CreditAttribution: jessebeach commentedI messed up the format of the diff in #5. Patching is a little new to me :)
Reposting
Comment #8
jessebeach CreditAttribution: jessebeach commentedApparently I must run diff from the root of the local repo.
Comment #10
jessebeach CreditAttribution: jessebeach commented#8: image.css_4.patch queued for re-testing.
Comment #11
jessebeach CreditAttribution: jessebeach commented#6: image.css_3.patch queued for re-testing.
Comment #12
effulgentsia CreditAttribution: effulgentsia commentedThanks! Setting component, and tagging, so the necessary maintainers find this.
Comment #13
jessebeach CreditAttribution: jessebeach commentedAssigning this issue to myself. Not sure what the etiquette of such an action is, but I'm glad to keep track of this issue.
Comment #14
Bevan CreditAttribution: Bevan commentedyched; Ah! Thanks. I had wondered that, but forgot to go and check before contributing the patch.
Jesse; There was a good reason why I used padding instead of margin and removed float:left. I can't remember exactly why, but believe it had something to do with how the field description (help text) and other columns wrap when the table is narrow and the image is wide but short, e.g. 100x10px. Sorry I don't have time to review and test right now.
Comment #15
jessebeach CreditAttribution: jessebeach commentedThe overflow:hidden on .image-widget-data
Keeps the text from wrapping around the floated .image-preview div. The height: 1% is there for IE6, otherwise it doesn't reset the block context of .image-widget-data, which is the purpose of overflow:hidden. This works even in a narrow case, but I do encourage you to verify this :) For this reason, there's no need to put spacing (padding or margin) on the bottom of .image-preview. .image-widget-data will adjust width automatically to fill in the space left after the width of .image-preview is taken into account. There's no need to float .image-widget-data.
Comment #16
Bevan CreditAttribution: Bevan commentedOkay. This needs a second review and manual test on common browsers, including IE6-9, before it can be RTBC.
Comment #17
dixon_The patch in #8 fixes the alignment problem in small resolutions (or in setups with large preview thumbnails). I agree with comment #16 that this patch is ok to go, but still needs test in IE6-9. I haven't been able to test in those browsers yet.
The patch still applies without offsets.
Comment #18
vikashsoni CreditAttribution: vikashsoni as a volunteer and at Zyxware Technologies commentedApplied patch #8, #6, #5 but not working sharing screenshot...