tei / photoswipe
TYPO3 PhotoSwipe-Plugin for native image-enlargement
Package info
github.com/j0nnybrav079/photoswipe
Language:JavaScript
Type:typo3-cms-extension
pkg:composer/tei/photoswipe
Requires
- php: ^8.2 || ^8.3 || ^8.4 || ^8.5
- typo3/cms-backend: ^14.3
- typo3/cms-core: ^14.3
- typo3/cms-frontend: ^14.3
Requires (Dev)
- typo3/testing-framework: ^9.6
Suggests
None
Provides
None
Conflicts
None
Replaces
- typo3-ter/photoswipe: 3.0.0
This package is auto-updated.
Last update: 2026-08-15 17:25:24 UTC
README
Native image enlargement and content layers powered by PhotoSwipe — plain JavaScript, no jQuery or other frameworks required.
Features
- Image lightbox — images with "click to enlarge" open in the PhotoSwipe gallery.
The image dimensions are added to the markup as
data-pswp-width/data-pswp-heightby theATagParamsuser function. - Content layer — link type "Layer" in the RTE and link wizard. A link pointing at a
content element (
#c123) renders its HTML inside the layer, a link pointing at a page opens it in an iframe. - Lazy loading with base64 preview — the
imagelazy64checkbox on a content element renders a tiny base64 placeholder first and loads the real image afterwards.
Compatibility
| Extension | TYPO3 |
|---|---|
| 3.0.x | 14.3 LTS |
| 2.0.x | 12.4 / 13.4 |
Installation
composer require tei/photoswipe
Afterwards include the static TypoScript "PhotoSwipe" in the backend.
Tests
composer install Build/runFunctionalTests.sh
The suite needs a reachable database and a user allowed to create databases; it
creates its own <name>_ft1 schema per run. Credentials come from the
typo3Database* environment variables, see Build/runFunctionalTests.sh.
The tests are deliberately regression focused — they cover the three mistakes that broke this extension on TYPO3 14:
- services that must be
publicsomakeInstance()resolves them through the container, - the link builder overriding
buildLink()instead of the removedbuild(), - the
lazy64argument being cast before comparison, and the TCAitemsformat.
What changed in 3.0.0 (TYPO3 14)
The extension no longer worked under v14 — in parts it returned HTTP 500 on every page. The following was adjusted:
PhotoSwipeLinkBuilder
build()→buildLink(). Since TYPO3 14 theLinkFactoryonly callsbuildLink()on builders implementingTypolinkBuilderInterface. The old method was never invoked again, which silently dropped alldata-pswp-*attributes.$GLOBALS['TSFE']->cObj→$request->getAttribute('currentContentObject').$GLOBALS['TSFE']no longer exists in v14.- Falls back to a plain link instead of throwing in the middle of the page rendering when no ContentObjectRenderer or no content is available.
Configuration/Services.yaml
PhotoSwipeLinkBuilderandImageService64arepublic: truenow. TYPO3 instantiates registeredtypolinkBuilderclasses throughGeneralUtility::makeInstance()without arguments; only a public service is resolved through the DI container. Without this:ArgumentCountError: Too few arguments to PageLinkBuilder::__construct(), 0 passed, 14 expectedon every page.
ImageService64
FrontendConfigurationManager::getTypoScriptSetup()requires the request since TYPO3 13.- Dependencies are injected through the constructor instead of
makeInstance()calls inside the methods. - Falls back to defaults when no frontend TypoScript is available, e.g. in the backend.
- The temporary file used for stripping EXIF data now lives in
var/transient/instead offileadmin/_processed_/and is unique per process — previously concurrent requests could overwrite each other's temporary file.
MediaViewHelper / ImageViewHelper
classandtitleare no longer registered arguments in Fluid 5. Both values are now read from the tag builder instead of$this->arguments.- Bugfix:
MediaViewHelpercompared$this->arguments['lazy64'] === 1strictly against an integer while Fluid passes the string"1". Base64 lazy loading never worked there.
LinkEventListener
Icon::SIZE_SMALL→IconSize::SMALL(enum since TYPO3 14).
TCA imagelazy64
itemsconverted to associative keys (label/value).
Misc
- Removed
ext_emconf.php— deprecated in TYPO3 14.3, the metadata lives incomposer.json. - Minimum requirement is PHP 8.2.