Media is only one module having is't own secure input formatter. It doesn't allowi CSRF to image uploader instead of INSERT or IMAGEPICKER modules.
But we need colorbox-enabled illustrations.
It would be nice to have option to use colorbox for image and video links made with media module.

Comments

mesr01’s picture

Here's a Custom Filter that you may import (admin/config/content/customfilter/tools) to enable Colorbox on all Media tags inserted in a Wysiwyg editor. Don't forget to enable the filter in the Text Formats configuration. This custom filter must run before the Media filter. I did not intensively test it, but it's working well for me so far.

Edit 2011-jul-25: Also, 'Colorbox inline' must be enabled in the Colorbox configuration section.

$filter = array(
  'fid' => _customfilter_map_filter_id('3'),
  'type' => base64_decode('bWVkaWFfY29sb3Jib3hfaW50ZWdyYXRpb24='),
  'name' => base64_decode('TWVkaWEgLSBDb2xvcmJveCBpbnRlZ3JhdGlvbg=='),
  'cache' => 0,
  'description' => base64_decode('SW50ZWdyYXRlcyBNZWRpYSBtb2R1bGUncyBuYXRpdmUgW1suLi5dXSB0YWdzIGludG8gQ29sb3Jib3gu'),
  'shorttip' => base64_decode('SW50ZWdyYXRlcyBNZWRpYSBtb2R1bGUncyBuYXRpdmUgW1suLi5dXSB0YWdzIGludG8gQ29sb3Jib3gu'),
  'longtip' => base64_decode('SW50ZWdyYXRlcyBNZWRpYSBtb2R1bGUncyBuYXRpdmUgW1suLi5dXSB0YWdzIGludG8gQ29sb3Jib3gu'),
);

$rules[] = array(
  'rid' => _customfilter_map_rule_id('4'),
  'fid' => _customfilter_map_filter_id('3'),
  'prid' => _customfilter_map_rule_id('0'),
  'name' => base64_decode('RW5jbG9zZSBtZWRpYSB0YWcgd2l0aGluIGNvbG9yYm94IG1hcmt1cA=='),
  'description' => base64_decode(''),
  'enabled' => 1,
  'matches' => base64_decode('MQ=='),
  'pattern' => base64_decode('e1xbXFsuKj9cImZpZFwiW2JsYW5rXSpcOltibGFua10qXCIoLio/KVwiLio/XF1cXX0='),
  'replacement' => base64_decode('PGEgY2xhc3M9Im1lZGlhIGNvbG9yYm94LWlubGluZSIgaHJlZj0iP2lubGluZT10cnVlI2NvbG9yYm94LW1lZGlhLSQxIj48ZGl2IGlkPSJjb2xvcmJveC1tZWRpYS0kMSI+JDA8L2Rpdj48L2E+'),
  'code' => 0,
  'weight' => 0,
);
rooby’s picture

Subscribing

Golem07’s picture

@mesr01

Thanks a lot for your solution which is basically working here.

However, my problem ist that e.g. images show in colorbox with the same size (image style) they already have in the node. So 100x100 thumbs are being displayed with these very dimensions in the colorbox as well which makes it kinda pointless to use. The corresponding setting in colorbox ('image style') doesn't seem to have any effect.

Am I doing something wrong or is this a limitation of they solution described here?

Thanks a lot in advance for your help!

nicolash’s picture

Is there colorbox support for media in general (not even inline)?

I can't find a field formatter or media styles setting to have a thumbnail opening a larger version in colorbox. Will I have to write my own style? Or is this something that could make it into media?

I know the media gallery module does this, but I've got a simpler use-case - just display a few images attached to a piece of content.

Still coming to terms with the whole media styles abstraction, so any pointers would be great.

nicolash’s picture

Never mind, suggestions in #1079300: showstoppers for using media module work well for now.

mesr01’s picture

@Golem07: A basic workaround (which I use myself) is to select the image style for the size you want in Colorbox and have your CSS shrink it to thumbnail size where thumbnails are needed.

kmadel’s picture

Status: Active » Needs review

There is also the new Media Colorbox module - a dev release should be available in less than 12 hours.

devin carlson’s picture

Status: Needs review » Closed (fixed)

Media Colorbox provides this integration and is now at release candidate 1.