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
Requires
- php: ^8.1
- ext-json: *
- contao/conflicts: @dev
- contao/core-bundle: ^4.13 | ^5.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- contao/test-case: ^5.0
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.4
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-symfony: ^1.1
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- slam/phpstan-extensions: ^6.0
- thecodingmachine/phpstan-strict-rules: ^1.0
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
andgallery
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 templatesrow
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
anddata-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