Problem/Motivation

Missing Next and Prev arrows when Photoswipe using in view fields.
I try both versions 4 and 5.

Steps to reproduce

Try to get PhotoSwipe to work in Views and fail.

Proposed resolution

Document in README that you need to add class photoswipe-gallery in Views, for PhotoSwipe galleries to work.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork photoswipe-3401194

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

VasyOK created an issue. See original summary.

anybody’s picture

Title: Missing Next and Prev arrows for views fields. » Photoswipe images in views are not shown as gallery
Version: 5.0.0-rc4 » 5.x-dev
Component: Miscellaneous » Documentation
Assigned: Unassigned » thomas.frobieter
Category: Bug report » Support request
Priority: Normal » Minor

Thanks 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-gallery wrapper 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 required photoswipe-gallery class.

@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.

anybody’s picture

TL;DR: Add the class photoswipe-gallery on the view or another dom element around the images you want to group into a gallery.

thomas.frobieter made their first commit to this issue’s fork.

thomas.frobieter’s picture

Status: Active » Needs review

@anybody Done, pls review.

anybody’s picture

Status: Needs review » Needs work

@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?

anybody’s picture

PS: Of course, community help with the documentation is highly appreciated.

thomas.frobieter’s picture

Assigned: thomas.frobieter » Unassigned

Well, I think it's good enough. I won't invest more time into this topic.

anybody’s picture

Issue tags: +Novice

Tagging 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.

anybody’s picture

Title: Photoswipe images in views are not shown as gallery » Document how to group photoswipe images into a gallery in views using photoswipe-gallery wrapper class
thomas.frobieter’s picture

Here is the required information to add classes to views:

https://www.drupal.org/docs/8/core/modules/views/customize-the-output-st...

vasyok’s picture

Thanx, @Anybody, you right!

I add class "photoswipe-gallery" to view field - and galleries worked!

ressa made their first commit to this issue’s fork.

ressa’s picture

Priority: Minor » Normal
Status: Needs work » Needs review

First, 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!

ressa’s picture

Issue summary: View changes

Adding some more context in Issue Summary.

grevil made their first commit to this issue’s fork.

grevil’s picture

Status: Needs review » Reviewed & tested by the community

Thanks once again @ressa!

LGTM!

grevil’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

ressa’s picture

Awesome @grevil, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.