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.
Using the insert module you can assign CSS classes to the inserted images. When using this in combination with colorbox, colorbox replaces these custom classes with its own.
CSS classes with Insert module
<img alt="People carpet the earth" class="image-medium caption" src="http://.../IGZhe.jpg">
CSS classes with insert module and colorbox
<img alt="People carpet the earth" class="imagecache imagecache-medium" src="http://.../IGZhe.jpg">
Comment | File | Size | Author |
---|---|---|---|
#10 | colorbox.add_insert_classes_1081546_10.patch | 2.12 KB | rfay |
#1 | colorbox_insert_class_1081546.patch | 2.94 KB | frjo |
Comments
Comment #1
frjo CreditAttribution: frjo commentedThanks for reporting this, I have messed up the theme function.
Please try out this patch and report your results back here.
Comment #2
bryancasler CreditAttribution: bryancasler commentedThis worked perfectly, thanks!
Comment #3
frjo CreditAttribution: frjo commentedCommitted to 7-dev.
Comment #5
frjo CreditAttribution: frjo commentedComment #6
jun CreditAttribution: jun commentedNot sure what the maintenance status of the D6 version is, but it would be great to back port this patch on it as well.
Comment #7
FiNeX CreditAttribution: FiNeX commentedIMHO there is still a problem (on the D7 version). When you add an image with insert _and_ without colorbox, the img class contains a reference to the style (and it is correct).
When you add an image using insert and you select a "colorbox + style" preset, you've only the additional CSS class specified in the "insert" field configuration.
A small fix can be applied on the colorbox.theme.inc file in the template_preprocess_colorbox_insert_image() function adding the missing class after setting the insert_class:
Comment #8
zoo CreditAttribution: zoo commentedHello,
Sorry, but this fix (#1 http://drupal.org/node/1081546#comment-4171964), works for the Drupal 7.x version of the colorbox module, it does not for Drupal 6.x version.
This issue was opened for the 6.x version of the colorbox module.
Anyone fixed this issue for the 6.x version of this module?
Thank you
zoo
Comment #9
rfayTrying to wrap my head around this. One would think it would be an easy fix.
Comment #10
rfayThis patch seems to do it for me. Please review, improve, commit.
Comment #11
soulfroys#10 works! Tks!
Comment #12
frjo CreditAttribution: frjo commentedCommitted to 6-dev, thanks rfay!