- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
The reason is, that if attaching the library via
photoswipe/photoswipe.init
the photoswipe container (from templates/photoswipe-container.html.twig) is missing on the page.That's a problem I have no solution for yet ...
- @anybody opened merge request.
- Status changed to Needs review
almost 2 years ago 5:54pm 1 March 2023 - 🇩🇪Germany Anybody Porta Westfalica
As the current error message is not very clear, let's at least add a better error message for now.
- Status changed to Postponed
almost 2 years ago 5:57pm 1 March 2023 - 🇩🇪Germany Anybody Porta Westfalica
Let's merge this improved error message for now, until we have a solution or decide to not fix this and use v5.
Workaround for now: Enable the global option at /admin/config/media/photoswipe
@anybody There should be a hook to load the libraries, as you told me :P
- Status changed to Closed: won't fix
almost 2 years ago 6:47am 2 March 2023 - 🇩🇪Germany Anybody Porta Westfalica
So I think as long as the JS library needs this boilerplate code, but it's not added in the library by JS (which we intentionally don't do), there's no solution here.
For Photoswipe v4 aka module version 3.x the only solution for such custom cases is to call
\Drupal::service('photoswipe.assets_manager')->attach($attachments);
in a hook or add the template code manually on the page before attachingphotoswipe/photoswipe.init
library.We won't fix this here for 3.x anymore.
In 🐛 Image Paragraph lightbox zoom misses to load photoswipe library Fixed I'll try to call
\Drupal::service('photoswipe.assets_manager')->attach($attachments);
via hook.