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.
Colorbox module does not preserve classes added by Media module.
I would like to suggest my modificaton to colorbox.theme.inc which allows to preserve all classes.
The code
if (isset($item['attributes']['class'])) {
$image['attributes']['class'] = $item['attributes']['class'];
}
needs to be added to function theme_colorbox_image_formatter after this
if (isset($item['width']) && isset($item['height'])) {
$image['width'] = $item['width'];
$image['height'] = $item['height'];
}
Comments
Comment #1
frjo CreditAttribution: frjo commentedThe 7.x-2.x dev version already have this code:
The classes should be included with this I believe. Please try out the diversion and report back here.
Comment #2
VSZ CreditAttribution: VSZ commentedYes, you are right. Latest dev preserve the classes.
Thank you.
Comment #3
frjo CreditAttribution: frjo commented