Download the PHP package dorsetdigital/silverstripe-photoswipe without Composer

On this page you can find all versions of the php package dorsetdigital/silverstripe-photoswipe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-photoswipe

Silverstripe PhotoSwipe

Responsive image galleries for Silverstripe CMS 6, powered by PhotoSwipe 5.

The module provides a ready-to-use Gallery Page, reusable extensions for adding a gallery to your own page types, and optional Elemental integration. PhotoSwipe and the default gallery layout use modern JavaScript and CSS with no jQuery or Bootstrap dependency.

Requirements

dnadesign/silverstripe-elemental is optional. If it is installed, a PhotoSwipe Gallery element is automatically available.

Installation

Install the module with Composer:

Then run a development build:

The module includes its compiled frontend assets, so applications installing it through Composer do not need to run npm or Vite.

Gallery Page

A Gallery Page page type is included and enabled by default. Create one in the CMS, add images to the Gallery tab and reorder them as required.

The supplied page template renders the page content followed by the gallery. A project can override the template in the usual Silverstripe way.

If a project does not want the bundled page type to be available in the CMS, disable it in project YAML:

Adding a gallery to another page type

Apply GalleryExtension to the page class and GalleryControllerExtension to its controller:

The page gains a Gallery tab in the CMS. Render the gallery in its template with:

Frontend requirements are only added when the page has gallery images.

Elemental

Elemental is an optional dependency. When dnadesign/silverstripe-elemental is installed, the module automatically exposes a PhotoSwipe Gallery block. No additional PhotoSwipe YAML is required.

A project without Elemental can install and use this module normally. If Elemental is installed later, run dev/build flush=1 and the gallery element will become available.

Schema.org structured data

The module optionally integrates with dorsetdigital/silverstripe-schema-manager. When Schema Manager is installed, PhotoSwipe galleries automatically contribute Schema.org ImageGallery structured data to the page's JSON-LD graph.

This applies to:

A dedicated GalleryPage promotes its ImageGallery to the page's main entity. Galleries embedded in other pages are linked to the page as supplementary entities instead. Multiple galleries on the same page receive distinct schema entity IDs.

Schema Manager is optional and no additional PhotoSwipe configuration is required. Install it separately if structured-data output is wanted:

Frontend and styling

Gallery images are rendered as ordinary links, so the gallery remains usable without JavaScript. PhotoSwipe progressively enhances those links into the lightbox.

The supplied template generates WebP images with a maximum width of 1600px for the lightbox and 550px for thumbnails. Images include intrinsic dimensions, lazy loading and asynchronous decoding.

The module always includes the CSS required by PhotoSwipe. It also includes a lightweight responsive CSS Grid layout by default. Browsers with CSS masonry support receive a progressive masonry enhancement.

To use your project's own gallery layout while retaining PhotoSwipe's functional CSS, disable only the module's default gallery styling:

The primary styling hooks are:

Templates

The shared gallery templates are:

Both the Gallery Page and Elemental implementation use the same gallery rendering, so project-level template overrides can be shared between them.

Upgrading from 1.x

Version 2 is a major release targeting Silverstripe CMS 6 and PhotoSwipe 5. It removes the old jQuery/PhotoSwipe 4 frontend and contains breaking namespace and implementation changes.

The former dorsetdigital/silverstripe-photoswipe-elemental package has been folded into this module. New installations should not install the separate Elemental package.

Experimental legacy Elemental migration

An experimental build task is included for sites migrating existing gallery blocks from dorsetdigital/silverstripe-photoswipe-elemental:

This task updates the stored Elemental class name while preserving the existing gallery table and image relationships.

This migration has not yet been verified against a production legacy installation. Back up the database before running it and test the migration in a non-production environment first. Version 2 does not currently guarantee automatic migration of legacy Elemental galleries.

Development

Frontend source is in client/src and is built with Vite.

For development with automatic rebuilds:

Compiled files in client/dist are committed to the package because they are exposed as Silverstripe module resources and consumed directly by Composer installations.

Credits


All versions of silverstripe-photoswipe with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
silverstripe/cms Version ^6
bummzack/sortablefile Version ^3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dorsetdigital/silverstripe-photoswipe contains the following files

Loading the files please wait ...