jimhare / kirby-cropper

crop images in the kirby panel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cropper – Kirby Cropper Field

This additional panel field for Kirby 2 allows you to crop images in the Panel.

Installation

Git Submodule

$ cd your/project/root
$ git submodule add --name kirby-cropper https://github.com/blankogmbh/kirby-cropper.git site/fields/cropper
$ cd site/fields/cropper
$ git submodule update --init --recursive

Add the following to you site/config/config.php

c::set('routes', array(
    // https://github.com/blankogmbh/kirby-cropper
    array(
        'pattern' => 'ajax-cropper',
        'action' => function () {
            include('site/fields/cropper/ajax_cropper.php');
        },
        'method' => 'POST'
    )
));

To Update your cropper field submodule to the latest available release follow these steps:

$ cd your/project/root
$ cd site/fields/cropper
$ git checkout master
$ git pull
$ cd ../../../
$ git commit -a -m "Update cropper submodule"

Usage

Within your blueprints

As soon as you dropped the field extension into your fields folder you can use it in your blueprints: simply add cropper fields to your blueprints and set some options.

fields:
  cropper:
    label: Cropping Area
    type: cropper
    ratios:
      - 16/9
      - 4/3
      - 
        label: portrait image
        value: 2/3

About

crop images in the kirby panel

License:MIT License


Languages

Language:PHP 83.3%Language:JavaScript 13.9%Language:CSS 2.8%