Skip to content
Adds jQuery Jcrop functionality to images in the SilverStripe CMS. Requires the Uploadify Module
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
code
css
js
templates/Includes
thirdparty
README.md
_config.php

README.md

silverstripe-uploaldify-jcrop

Adds jQuery Jcrop functionality to images in the SilverStripe CMS. Supports constraining Image Crop Area to an Aspect Ratio. Built on Jcrop version 0.9.10 (http://deepliquid.com/content/Jcrop.html)

Requirements

Basic Usage

Implement JcropImageUploadField (which in term extends Uploadify's ImageUploadField)

class Spotlight extends DataObject {
    static $media_upload_folder = 'spotlights';

    static $db = array(
        'Title'             => 'Varchar',
    //  ....
    );

    static $has_one = array(
        'Graphic'           => 'Image'
    );

    public function getCMSFields($params = null){
        $fields = parent::getCMSFields($params);

        $field = new JcropImageUploadField('Graphic');
        $field->uploadFolder = self::$media_upload_folder;
        $field->setAspectRatio(16/9);

        $fields->replaceField('Graphic',$field);

        // ...

        return $fields;
    }


}

Maintainer Contacts

License

This module is licensed under the BSD license at http://silverstripe.org/BSD-license

Project Links

Something went wrong with that request. Please try again.