When using the insert module, the images that get inserted with a Colorbox style don't have the style class that they get with non Colorbox styles.

I modified colorbox.theme.inc to fix it. A patch follows.

Comments

jox’s picture

jox’s picture

Here is an example to explain this more in detail:

Suppose a content type with an image field with insert button and two syles enabled: 'medium' and 'Colorbox medium'.

Now an image is uploaded, stlye 'medium' is selected and the insert button is pressed. The class attribute of the resulting img will include image-medium.

Now stlye 'Colorbox medium' is selected and the insert button is pressed. The class attribute of the resulting img will not include image-medium (nor something silmilar).

frjo’s picture

Category: bug » feature
StatusFileSize
new1.22 KB

Could you please try this patch instead to se if it works for you?

It adds the image-[stylename] class and runs alla classes through drupal_html_class().

jox’s picture

Great. Works fine, thanks.

One minor thing. I would name the variable $classes instead of $class, since it is an array that can contain multiple values. That would be just a little more meaningful naming. A modified patch is attached.

frjo’s picture

Status: Needs review » Fixed

Committed to 7-dev. Thanks for testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

zoo’s picture

Is there by any chance a fix which is back ported for the 6.x version of the colorbox module? Thank you!

kerios83’s picture

Great I have been waiting for this !