Closed (fixed)
Project:
PhotoSwipe - Responsive JavaScript Modal Image Gallery
Version:
5.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Nov 2023 at 10:42 UTC
Updated:
8 Oct 2025 at 12:39 UTC
Jump to comment: Most recent
Comments
Comment #2
anybodyThanks for raising this. It's not a bug, but there's missing information in the README.md that needs to be added to show images from a Drupal view in a Photoswipe Gallery.
If not adding a
photoswipe-gallerywrapper class in the view around, the photoswipe images won't be shown as gallery, but as single pictures. That's expected, but we should document how to group them into a gallery by adding the requiredphotoswipe-galleryclass.@thomas.frobieter could you elaborate on that in a MR for the README.md? There's already a views subheading, which I think we should extend with the info where the class can / should be put.
I think it would be in the image field or in the views style?
Don't think we'll ever be able to add a UI for that while keeping the required flexibility.
Comment #3
anybodyTL;DR: Add the class
photoswipe-galleryon the view or another dom element around the images you want to group into a gallery.Comment #6
thomas.frobieter@anybody Done, pls review.
Comment #7
anybody@thomas.frobieter nice! If possible could you please:
- Use code style for the class snippets
- Eventually add a code example if someone advanced wants to do it code-wise in a template?
- But more important, I think: Additionally to the general explanation, perhaps add the steps a user has to take in the Views UI to add these classes (for less advanced users)
Perhaps @LRWebks can help you with details?
This has low priority, but I think we should help newbies as good as possible.
Perhaps we should generally review the README and check if it explains the general concepts good enough for users starting with PS?
BTW. when using a single image field with the photoswipe formatter, I think these will be grouped, but not for cases where you'd like to have a gallery across fields or view results?
Comment #8
anybodyPS: Of course, community help with the documentation is highly appreciated.
Comment #9
thomas.frobieterWell, I think it's good enough. I won't invest more time into this topic.
Comment #10
anybodyTagging for community help to add the steps to be taken in the View UI to add the classes there. @thomas.frobieter added the required general steps / themer steps.
Comment #11
anybodyComment #12
thomas.frobieterHere is the required information to add classes to views:
https://www.drupal.org/docs/8/core/modules/views/customize-the-output-st...
Comment #13
vasyok commentedThanx, @Anybody, you right!
I add class "photoswipe-gallery" to view field - and galleries worked!
Comment #15
ressaFirst, thanks for maintaining this amazing module, it works really well, and looks great!
Adding the class is required to make the module work in Views, otherwise the user will click an image, and nothing happens ...
In my opinion, this is a pretty big deal, since the user will think that the module doesn't work, and potentially waste significant time searching, to try to find a solution ...
In that sense, the Views instructions in the README has a major problem, so increasing the Priority.
I have added link to the Views documentation, and hope this MR can get committed ASAP, to help new users avoid wasting time needlessly :) Thanks!
Comment #16
ressaAdding some more context in Issue Summary.
Comment #18
grevil commentedThanks once again @ressa!
LGTM!
Comment #20
grevil commentedComment #22
ressaAwesome @grevil, thanks!