marketo/silverstripe-contextawareuploadfield

This package is abandoned and no longer maintained. No replacement package was suggested.

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

Maintainers

Package info

github.com/Marketo/SilverStripe-ContextAwareUploadField

Type:silverstripe-module

pkg:composer/marketo/silverstripe-contextawareuploadfield

Statistics

Installs: 6 182

Dependents: 0

Suggesters: 0

Stars: 4

Open Issues: 0

dev-master 2017-03-05 22:52 UTC

This package is auto-updated.

Last update: 2024-03-15 17:18:15 UTC


README

Requirements

  • SilverStripe ^3.1

Installation

The recommended way to install the module is via composer

composer require marketo/contextawareuploadfield:dev-master

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

Examples

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

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.

upload_paths also accepts SilverStripe dot notation. For example:

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.

Injector:
  UploadField:
    class: ContextAwareUploadField

Run a dev/build?flush=1 to flush the config manifests to enable the new configuration.

License

See License

Maintainers

Bugtracker

https://github.com/Marketo/SilverStripe-ContextAwareUploadField/issues