dravencms / gallery
Gallery module for dravencms
Requires
- dravencms/admin: ^3.0
- dravencms/application: ^0.3
- dravencms/file: ^4.0
- dravencms/tag: ^2.0
Requires (Dev)
- nette/tester: @dev
Suggests
- dravencms/structure: Allows gallery components to be used in cms
Provides
None
Conflicts
- dravencms/admin: <3.2
- dravencms/user: <3.1
Replaces
None
- dev-master
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.6
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0
- v1.0.21
- v1.0.20
- v1.0.19
- v1.0.18
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0
This package is auto-updated.
Last update: 2026-11-06 21:23:01 UTC
README
Image-gallery administration and frontend components for DravenCMS. Galleries use the File package for stored media and the Tag package for classification.
Features
- Gallery and picture administration.
- Upload from managed file structures.
- Picture ordering, captions, activation, and tags.
- Overview and detail frontend components for CMS pages.
- Commands for historical link migration and gallery retention cleanup.
- Provider-defined admin navigation and ACL permissions.
Installation
composer require dravencms/gallery
The package loader registers the extension, admin presenter, services, and Doctrine mappings. Apply the package schema through the application's migration workflow before using the gallery. Navigation and permission definitions come from providers; assign permissions through the group editor.
Frontend Integration
With dravencms/structure installed, the package exposes Gallery Overview and Gallery Detail component factories to the CMS. Their ICmsActionOption configuration selects the content rendered by each placement.
Application code can also inject OverviewFactory or DetailFactory directly when it already has the corresponding CMS action option.
Maintenance Commands
Keep only a defined number of newest galleries:
php bin/console gallery:gallery:clean 20
Migrate historical direct picture-file relationships to StructureFileLink records:
php bin/console gallery:gallery:migrate-link
Both commands modify persisted gallery/file relationships. Back up the database and file data before using them on existing installations.
License
This package is licensed under the LGPL-3.0-only license.
Gallery file storage
The gallery creates its root gallery file structure when the first picture upload needs it and reuses it on later uploads. No fixture or setup command is needed. Existing file structures and files are retained; a structure named gallery below another parent does not replace the gallery root.
Admin authorization and mutations
Administration uses User 3.1, Admin 3.2 and Application 0.3 guards. Screens and write callbacks enforce the existing provider-defined permissions server-side, including direct URLs and bulk callbacks. Mutating signals require POST and a session-bound action token; synchronize the matching admin assets when upgrading. See the User package's user:security:migrate instructions for the password-reset schema change.
Contextual file delivery
This release requires Dravencms File 3 / Nette Files 3. Image URLs include a specific file resolver and attachment reference; templates no longer pass bare files. Published attachments are public-cacheable; admin previews of unpublished content require the plugin's edit permission and are private. Original files and generated images stay outside the document root. Install the private-storage configuration and run File's checksum/storage migrations before serving this release. See the File package README.
Variant configuration (3.1)
This package declares its own variants in dravencms.config.neon; Nette merges the
files.variants maps. Definitions use named width, height and resizeMode fields.
resizeMode defaults to fit; an omitted/null dimension is unconstrained, and at
least one dimension is required. On upgrade, replace old positional definitions
and remove variants owned by other packages from the File configuration. Project
variants belong in project configuration. Update the matching File, Nette Files
and installed Gallery/Article/Partner/Carousel releases together. No additional
database or storage migration is needed for this configuration change.
Dashboard
With Admin 3.5 installed, this package automatically registers an ACL-protected dashboard panel showing total and enabled galleries. Aggregate data is loaded only when an authorized user renders the panel. No setup command or migration is required.