- 🇩🇪Germany Grevil
The problem is, that we currently attach photoswipe twice. Once through this code inside the drowl_paragraphs module file:
/** * Helper function for image paragraph types with field "image_zoomable". */ function _drowl_paragraphs_types_preprocess_paragraph_image_zoomable(&$variables) { // TODO: Remove all this and put a simply {{ attach_library('photoswipe/photoswipe.init') }} // into flexible_image.html.twig to initialize photoswipe, once // photoswipe doesn't need a HTML5 template anymore. // That will be the case with Photoswipe v5! // for details see https://www.drupal.org/project/drowl_paragraphs/issues/3345294 $paragraph = $variables['paragraph']; if ($paragraph->hasField('field_paragraphs_image_zoomable') && !$paragraph->get('field_paragraphs_image_zoomable')->isEmpty()) { // Attach the photoswipe library and template, if zoom is enabled: \Drupal::service('photoswipe.assets_manager')->attach($variables); } }
And once through the photoswipe 'Load PhotoSwipe on all non-admin pages' option and adding the 'photoswipe' class to the image link in flexible_image.html.twig. Furthermore, the pswp data attributes are not compatible with Photoswipe 5 (as @thomas.frobieter pointed out).
data-size="1280x397" (old) vs. data-pswp-width="1280" / data-pswp-height="618" (new)
- last update
over 1 year ago Composer require failure - @grevil opened merge request.
- Status changed to Needs review
over 1 year ago 11:23am 18 August 2023 - 🇩🇪Germany Grevil
Ok, all done, should work with photoswipe 5 now. We need to make sure to disable the global photoswipe option once enabled.
- last update
over 1 year ago Composer require failure - 🇩🇪Germany Anybody Porta Westfalica
@thomas.frobieter releasing this will force us to upgrade all pages using drowl_paragraphs 4.x to use Photoswipe 5. From my perspective that's okay and better than having one additional branch. Do you agree?
- Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.0 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass -
thomas.frobieter →
committed 8f43ba70 on 4.x authored by
Grevil →
Issue #3296247: Make drowl_paragraphs Photoswipe 5 compatible
-
thomas.frobieter →
committed 8f43ba70 on 4.x authored by
Grevil →
- Status changed to Fixed
over 1 year ago 1:09pm 18 August 2023 -
thomas.frobieter →
committed 0201fbb4 on 4.x
Issue #3296247 > Add the Photoswipe library to DROWL image paragraphs...
-
thomas.frobieter →
committed 0201fbb4 on 4.x
Automatically closed - issue fixed for 2 weeks with no activity.