- 🇩🇪Germany Anybody Porta Westfalica
Unlocked now and would be *really* useful! Could someome please prepare a MR?
- 🇩🇪Germany Anybody Porta Westfalica
MAYBE it works out of the box now in 5.x as we don't need the HTML snippets anymore and eventually not even an initialization?
If an initialization is needed, it should be based on the global settings, so that we can include the library with the global settings easily, working out of the box. If anyone then needs special configuration, that has to be done in contrib.@Grevil if anything is unclear here about the reason why and the focus of this task, I'll show you a clear example.
- 🇩🇪Germany Anybody Porta Westfalica
Pinging @thomas.frobieter as this might be highly relevant for him. Please subscribe.
- Assigned to Grevil
- 🇩🇪Germany Grevil
I don't quite get it. How is "attach()" from the PhotoswipeAssetsManager executed, when we simply attach the library through
{{ attach_library('photoswipe/photoswipe') }} {{ attach_library('photoswipe/photoswipe.init') }}
?
- 🇩🇪Germany Anybody Porta Westfalica
@Grevil: Re #18: It isn't! That was already the problem in 4.x and I was hoping we don't need that method anymore. The original issue summary was against 4.x
We should try to get attach() removed.
Background information: For older Photoswipe versions (4.x) Photoswipe required the user to add the whole photoswipe markup to the page footer manually. That was the big problem with 4.x to solve this... but it seems it's still problematic.
- 🇩🇪Germany Anybody Porta Westfalica
As it seems, the best solution instead might be to provide a twig function
{{ attach_photoswipe() }}
Later on, it might be interesting to be able to override settings in the parameter:
{{ attach_photoswipe($settings) }}
See the
{{ attach_library }}
implementation here: https://git.drupalcode.org/project/drupal/-/commit/a2efc8a8edccc34d9ba8c...That way we should hopefully be able to pass the global settings and still use the asset manager.
- 🇩🇪Germany Grevil
Ok this should already work, but we should test it manually and through tests.
- last update
over 1 year ago 10 fail - @grevil opened merge request.
- 🇩🇪Germany Anybody Porta Westfalica
@Grevil: Cool! I left some comments to finish this on monday, plus tests.
There's also an (incomplete) test example at https://git.drupalcode.org/project/drupal/-/commit/a2efc8a8edccc34d9ba8c... - the other parts eventually already exists before and you have to look them up in the core code...
- last update
over 1 year ago 10 fail - last update
over 1 year ago 10 fail - last update
over 1 year ago 18 pass - last update
over 1 year ago 17 pass, 2 fail - last update
over 1 year ago 15 pass, 4 fail - last update
over 1 year ago 15 pass, 4 fail - last update
over 1 year ago 15 pass, 4 fail - last update
over 1 year ago 15 pass, 4 fail - Status changed to Needs review
over 1 year ago 3:02pm 7 August 2023 - 🇩🇪Germany Grevil
Please review, should be Green, maybe 1 test will fail, we'll see.
- Status changed to Needs work
over 1 year ago 3:10pm 7 August 2023 - last update
over 1 year ago 17 pass, 2 fail - last update
over 1 year ago 17 pass, 1 fail - last update
over 1 year ago 19 pass - Status changed to Needs review
over 1 year ago 7:34am 8 August 2023 - 🇩🇪Germany Grevil
Finally, fixed! Added tests to check if the twig theme function works as expected and if it can override global photoswipe settings.
- last update
over 1 year ago 19 pass - Issue was unassigned.
- Status changed to RTBC
over 1 year ago 7:46am 8 August 2023 - 🇩🇪Germany Anybody Porta Westfalica
Let's merge this and make @thomas.frobieter happy ;)
Nice feature!! - last update
over 1 year ago 19 pass - Status changed to Fixed
over 1 year ago 7:47am 8 August 2023 - 🇩🇪Germany Anybody Porta Westfalica
@Grevil: Do good things and talk about it! I forgot, we should add the snippet to the README.md (and the module page?). Could you do that, please?
Automatically closed - issue fixed for 2 weeks with no activity.