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">
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frjo’s picture

Thanks for reporting this, I have messed up the theme function.

Please try out this patch and report your results back here.

bryancasler’s picture

This worked perfectly, thanks!

frjo’s picture

Status: Active » Fixed

Committed to 7-dev.

Status: Fixed » Closed (fixed)

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

frjo’s picture

Title: Colorbox is replacing CSS classes from insert module » Fix the call to theme_colorbox_insert_image() and add in the CSS classes from insert module
jun’s picture

Version: 7.x-1.0-beta2 » 6.x-1.0-beta10
Status: Closed (fixed) » Patch (to be ported)

Not sure what the maintenance status of the D6 version is, but it would be great to back port this patch on it as well.

FiNeX’s picture

IMHO 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:

  $variables['class'] .= " image-".$variables['item']['style_name'];
zoo’s picture

Hello,

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

rfay’s picture

Version: 6.x-1.0-beta10 » 6.x-1.x-dev

Trying to wrap my head around this. One would think it would be an easy fix.

rfay’s picture

Status: Patch (to be ported) » Needs review
FileSize
2.12 KB

This patch seems to do it for me. Please review, improve, commit.

soulfroys’s picture

#10 works! Tks!

frjo’s picture

Status: Needs review » Fixed

Committed to 6-dev, thanks rfay!

Status: Fixed » Closed (fixed)

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