fof / photoswipe
Flarum PhotoSwipe integration
Package info
github.com/FriendsOfFlarum/photoswipe
Language:JavaScript
Type:flarum-extension
pkg:composer/fof/photoswipe
Fund package maintenance!
Requires
- php: ^8.3
- flarum/core: ^2.0
Requires (Dev)
- flarum/testing: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
This package is auto-updated.
Last update: 2026-10-13 20:22:13 UTC
README
A Flarum extension. PhotoSwipe integration.
Installation
Install with composer:
composer require fof/photoswipe:"*"
Updating
composer update fof/photoswipe:"*"
php flarum assets:publish
php flarum cache:clear
For Developers
Gallery extender
Use the Gallery extender to add PhotoSwipe lightboxes to your own extension's components.
With fof/photoswipe declared as an optional dependency, in your extension's js/src/forum/extend.ts:
import Gallery from 'ext:fof/photoswipe/forum/extenders/Gallery'; export default [ ...('fof-photoswipe' in flarum.extensions ? [new Gallery('ext:custom/extension/forum/components/ContentPage', '.ContentPage-body')] : []), ];
Pass a component class or module path (preserving lazy loading) and a container selector. Each matching container, including the root, is a separate gallery; containers must not be nested. The default image link selector is a[data-pswp], a.FoFUpload--Upl-Image-Preview-Link; override it with a third argument: { children: 'a.custom-image' }.