xirdion/contao-photoswipe-bundle

contao bundle to add the photoswipe lightbox to a contao project

Installs: 46

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 2

Forks: 1

Open Issues: 3

Language:JavaScript

Type:contao-bundle

1.1.0 2022-09-21 13:39 UTC

This package is not auto-updated.

Last update: 2024-11-05 18:29:00 UTC


README

This bundle implements Photoswipe.js as lightbox for images and galleries.

Note:

A customized version of photoswipe ist used otherwise there was an error closing the lightbox.

The code was upgraded according to this issue.

Additional HTML markup is added dynamically while parsing the templates:

  • At the moment only image and gallery templates are taken into account
  • A unique photoswipe-gallery-class (pswp__container--<template-ID>) is generated and added to following template-properties:
    • floatClass for image templates
    • row for gallery templates
  • The data-pswp-src is added to the image anchor tag
  • The dimensions of the original image are added with data-pswp-width and data-pswp-height to the image tag

The additional CSS and JS resources are added to the response only if there are any unique photoswipe selectors