Add this extension to any page type, to get the following batch image upload interface in the CMS:
It allows images to be bulk uploaded, drag and drop reordering and inline caption adding.
Or use the following modules:
- Basic Image Gallery Page - Uses this extension to provide Image Gallery Page and Image Gallery Holder page types.
- Basic Image Gallery Elemental Block - Uses this extension to provide an Image Gallery Elemental block.
- James Cocker (ssmodulesgithub@pswd.biz)
- Silverstripe 5
Install: Until this PR is merged: Add to composer.json:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/purplespider/GridFieldBulkEditingTools"
}
],
Add to require
:
"colymba/gridfield-bulk-editing-tools": "dev-ss5-fix-json2array as 4.0",
Then install this module:
composer require purplespider/silverstripe-basic-gallery-extension ^4
Upgrading to v3 will break existing galleries due to a change to a polymorphic relation, to fix:
- Run
dev/build
- Run
/dev/tasks/upgrade-basic-galleries
script.
The Extension can be applied to any page type to enable the gallery functionality.
You can also customise the CMS tab that the gallery appears on, as well as the title of the gallery displayed in the CMS, and rename the main Content tab:
---
Name: custom-basic-gallery-extension
After: basic-gallery-extension
---
HomePage:
extensions:
- PurpleSpider\BasicGalleryExtension\PhotoGalleryExtension
gallery-title: Image Gallery
gallery-cms-tab: Main
content-cms-tab: Top Content
To automatically delete image files when an image is deleted from a gallery:
---
Name: custom-basic-gallery-extension
After: basic-gallery-extension
---
PurpleSpider\BasicGalleryExtension\PhotoGalleryImage:
ondelete_delete_image_files: true
This uses Delete Asset If Unused Extension to detect if the image is being used elsewhere on the site, and will only delete it if it isn't. There are caveats though, so check this module's readme, i.e. you might not want to use this on sites that have been upgraded from Silverstripe 3.