Craft CMS Keyteq Mediaflow plugin. Read more Visit Mediaflow!
composer require mediaflow/mediaflow-craft:~1.0
Modify your public/index.php
to autoload depdendencies by adding this as the second to last line:
require __DIR__ . '/../vendor/autoload.php';
This is only required once for all plugins using composer
plugins/mediaflow/
You can define crop sizes in the Mediaflow custom fields
{"main":[400,500],"list-view":[500,300],"thumb":[100,100],"content-head":[800,316]}
In your template you can do the following:
<img src="https://github.com/KeyteqLabs/mediaflow-craft/raw/master/{{ entry.yourImage.url('list-view') }}" />
<img src="https://github.com/KeyteqLabs/mediaflow-craft/raw/master/{{entry.mediaflowField.url({width: 100,height: 100}) }}" />
{% set media = entry.mediaflowField %}
<img data-interchange="
[{{ media.url({width:width,height:height,quality:90}) }}, (default)],
[{{ media.url({width:width,height:height,quality:90}) }}, (large)]
">
<noscript>
<img src="https://github.com/KeyteqLabs/mediaflow-craft/raw/master/{{media.url({width:width,height:height,quality:90}) }}">
</noscript>