2017 © Pedro Peláez
 

silverstripe-module silverstripe-contextawareuploadfield

An upload field that makes use of configuration and keywords for determining the upload target

image

marketo/silverstripe-contextawareuploadfield

An upload field that makes use of configuration and keywords for determining the upload target

  • Sunday, March 5, 2017
  • by nyeholt
  • Repository
  • 13 Watchers
  • 4 Stars
  • 3,856 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

SilverStripe Context Aware Upload Field

Requirements

  • SilverStripe ^3.1

Installation

The recommended way to install the module is via composer, (*1)

composer require marketo/contextawareuploadfield:dev-master

If you aren't using composer, pull down the code into its own directory., (*2)

Examples

To add this to a Page object, you can put the following code into your YAML configuration., (*3)

ContextAwareUploadField:
  upload_paths:
    Page: some/location/$ClassName/$URLSegment

The segments in the URL directly correspond to fields in the database. The location will always be under assets., (*4)


upload_paths also accepts SilverStripe dot notation. For example:, (*5)

ContextAwareUploadField:
  upload_paths:
    Teacher: teachers/$Name
    Course: teachers/$Teacher.Name/$Name
    Student: students/$GraduatingClass.Year/$Name

If you wish to override all UploadField instances, you can use the following code., (*6)

Injector:
  UploadField:
    class: ContextAwareUploadField

Run a dev/build?flush=1 to flush the config manifests to enable the new configuration., (*7)

License

See License, (*8)

Maintainers

Bugtracker

https://github.com/Marketo/SilverStripe-ContextAwareUploadField/issues, (*9)

The Versions

05/03 2017

dev-master

9999999-dev

An upload field that makes use of configuration and keywords for determining the upload target

  Sources   Download

BSD-3-Clause

The Requires

 

by Tom Brewer-Vinga

file upload silverstripe