Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Changes the default folder for choosing existing files through UploadField to the folder set with setFolder()(if set).

License

Notifications You must be signed in to change notification settings

xini/silverstripe-upload-folder-select-handler

SilverStripe default file select folder

This is an archived project and is no longer maintained. Please do not file issues or pull-requests against this repo. If you wish to continue to develop this code yourself, we recommend you fork it or contact us.

Version License

Overview

Changes the default folder for choosing existing files through UploadField to the folder set with setFolder() (if set).

SilverStripe 3.2 introduced a new default behavior for UploadField that shows files in all folders by default when "Select from files" is selected.

Now, if you tried to keep the assets tidy in the past, you have probably used 'setFolder()' on your UploadFields to define a folder within assets where your particular files should be uploaded to. To let a user select files from that particular upload folder, you would now have to add 'setDisplayFolderName()' as well:

UploadField::create('MyField')->setFolder('MyUploads')->setDisplayFolderName('MyUploads');

This module removes this extra step by automatically setting the display folder to the upload folder if that is defined for an UploadField.

SilverStripe 4 compatibility

This module will be obsolete by the changes introduced in this pull request (probably SS 4.2). There won't be a SS4 compatible version of this module.

Requirements

  • SilverStripe Framework ~3.2

Installation

Install the module using composer:

composer require innoweb/silverstripe-upload-folder-select-handler dev-master

or download or git clone the module into a ‘upload-folder-select-handler’ directory in your webroot.

Then run dev/build.

License

BSD 3-Clause License, see License

About

Changes the default folder for choosing existing files through UploadField to the folder set with setFolder()(if set).

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages