Search by

fof / photoswipe

imorlandrafaucau

Flarum PhotoSwipe integration

Package info

github.com/FriendsOfFlarum/photoswipe

Homepage

Forum

Language:JavaScript

Type:flarum-extension

pkg:composer/fof/photoswipe

Fund package maintenance!

Website

Statistics

Installs: 2 693

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v2.0.0 2026-10-13 16:19 UTC

README

License Latest Stable Version Total Downloads

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' }.

Links