- Issue created by @erwangel
- 🇮🇩Indonesia gausarts
Thank you.
I have usages different from yours, relevant to various Blazy options (mixed media like local video, audio, document, iframe, inline HTML like pinterest, etc.) and sub-modules' specific features however I understand your scenarios.
Perhaps marrying both is less disruptive, a matter of option so to preserve BC.The following may need proper checks, but a good start.
A permanent solution if you or anyone want to patch:
- Create a new option at Blazy UI to offer using internal URL for hence
[data-box-url]for video lightbox HREF url so that the next change doesn't affect or break initial design. This is the #url line to modify:
https://git.drupalcode.org/project/blazy/-/blob/3.0.13/src/Theme/Lightbo... - To not break the old logic flow, access and store
[data-box-url]into a new$href_urlvariable:
https://git.drupalcode.org/project/blazy/-/blob/3.0.13/src/Theme/Lightbo... - Then change into IF ELSE:
If UI option is enabled and$href_urlis not empty, then put it as #url, else use the original #url line, e.g.:
if ($ui_enabled && $href_url = $attrs['data-box-url'] ?? NULL)
Urgent solution is similar to above, available via hook_preprocess_blazy:
Check if[data-box-url]exists and only if a lightbox, to not break other options like Link image to content, to original image, etc., override it:
$variables['url'] = [data-box-url] value;blazy.api.php:
https://git.drupalcode.org/project/blazy/-/blob/3.0.13/blazy.api.php?ref...Sub-modules to explore sample variables and possibilities:
https://git.drupalcode.org/project/zooming/-/blob/2.0.x/zooming.module?r...
https://git.drupalcode.org/project/splidebox/-/blob/2.0.x/src/Splidebox....
https://git.drupalcode.org/project/slick_lightbox/-/blob/8.x-1.x/slick_l...
https://git.drupalcode.org/project/intense/-/blob/3.0.x/intense.module?r...
https://git.drupalcode.org/project/elevatezoomplus/-/blob/2.0.x/src/Elev...Zooming is the closest to your need.
Moved to Blazy for the correct patch, if any.Let me know?
- Create a new option at Blazy UI to offer using internal URL for hence
- 🇫🇷France erwangel
Thank you for your reply. It is fantastic what we can do with blazy hooks. The thing is that we have no way of knowing if colorbox is active or not (mobile detected or not) unless we dig into the javascript. I tried setting a breakpoint in Slick/Splide optionset at the same width as the Colorbox mobile detection setting, but again I don't think we can know which is the active breakpoint as it is handled on the browser side. I'm wondering if the solution could not be CSS-breakpoints in order to show/hide the colorbox div.