I've just started using picture 2 days ago and I'm actually digging deeper and deeper.
Most things, like field formatters, work already flawless. Very nice; thanks for all the hard work.

But what about colorbox support for inline images?

Contributed modules, like 'insert', do inject their own static colorbox-link.
That's working and the images within already get replaced by picture, but the colorbox link is not adressed yet so not responsive.
Additionally we don't want such inputs to be replaced directly; then we would get problems with the input filtering on page views.

A solution could be...

(1) data-picture-colorbox tag
A data-picture-colorbox tag and related colorbox setting in ckeditor's image dialogue ('Enable colorbox' -> 'select breakpoint-group') would be enough to extend the existing functionality to our needs.
We'd still filter img tags. But additionally provide the exisiting colorbox-support if the data-picture-colorbox tag is set.
Not much effort and nice logic i think; but the new custom data tag needs to be communicated with media and others.
This function should cover manual colorbox-link creation.

(2) Extend input filtering
Maybe impossible!? Maybe too much ressources needed, again, so we should matter about lazy-loading first!? And such a filter could only be driven by global settings; does this make enough sense?
This function should cover re-writing contributed, static, colorbox-links.

I will try to create a patch for the first approach the next days.
So far... any ideas or suggestions?

Comments

das-peter’s picture

I think the Media module / WYSIWYG integration should work.
However there are some known issues with the integreation of Media into WYSIWYG:
Media: #1970370: Split media token handling from WYSIWYG integration javascript
CKeditor: #1504696: Integration with CKEditor module

R2-D8’s picture

@das-peter Thank you for the info; that's definitely urgent and I'll take care of your patches/ideas.

das-peter’s picture

@R2-D8 Would be great to have more attention on that issues :) It's easier to do the required lobbying with more stakeholders :P

attiks’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

DaPooch’s picture

Sorry to reopen an old thread, but can anyone provide details of how this works. Trying to get all images created in ckeditor to automatically have colorbox applied to it.