Install PhotoSwipe

Last updated on
5 November 2024

This documentation needs review. See "Help improve this page" in the sidebar.

Module Installation

Install as you would normally install a contributed Drupal module. For further
information, see Installing Drupal Modules

Photoswipe 5 library installation

Compatible with photoswipe:^5 (beta) module only!

  • Enable usage of third-party libraries using composer, see here for an explanation.
  • Require the photoswipe library using composer require bower-asset/photoswipe:^5
  • (Optional) Require the photoswipe dynamic caption plugin using composer require npm-asset/photoswipe-dynamic-caption-plugin:^1.2
  • Check your status report

Manual

  • Download the "PhotoSwipe-5.3.8" zip file
  • Unzip and place the contents of the unzipped "PhotoSwipe-5.3.8" folder into "library/photoswipe" folder so that the folder structure is: library/photoswipe/dist/photoswipe.esm.js
  • (Optional) See how to manually require the photoswipe dynamic caption plugin here
  • Check the status report for errors

CDN

  • Go to '/admin/config/media/photoswipe' and enable the 'Load PhotoSwipe library from CDN' option
  • Check the status report for errors

Photoswipe 4 library installation

Compatible with photoswipe:^4 module only!

  • Enable usage of third-party libraries using composer, see here for an explanation.
  • Require the photoswipe library using composer require bower-asset/photoswipe:^4
  • Check your status report

Manual

  • Download the "PhotoSwipe-4.1.3" zip file
  • Unzip and place the contents of the unzipped "PhotoSwipe-4.1.3" folder into "library/photoswipe" folder so that the folder structure is: library/photoswipe/dist/photoswipe.js
  • Check the status report for errors

CDN

  • CDN is used as a fallback, if the photoswipe library isn't installed.

Then simply configure your image fields to use Photoswipe as their field display handler.

Note: If you would like to use the "Photoswipe Responsive" display formatter, please enable the core "Responsive Image" module first.

Extending modules

  • PhotoSwipe Inline Text Filter: Provides a Text Filter to make your inline images (e.g. images inserted through CKEditor for example) use photoswipe without manually adding HTML / CSS

Drupal 7 specific setup

The Drupal 7 version depends on jquery_update (>2.2).
Because PhotoSwipe needs a jQuery version bigger than 1.5, jquery_update version 2.2 won't work. Please use the 2.3 version and make sure you have selected jQuery version 1.7 (recommended) or 1.8 in jquery_update settings.

Drupal 7 version information:

  • Branch 7.x.4.x: For PhotoSwipe v4.x
  • Branch 7.x.1.x: For PhotoSwipe v3.x (NOT SUPPORTED ANYMORE!)

Help improve this page

Page status: Needs review

You can: