dlambauer/magento2-module-backend-widget-imageupload

Simply add Images to your Widget

1.0.0 2016-08-30 07:44 UTC

This package is auto-updated.

Last update: 2022-07-14 13:53:31 UTC


README

Introduction

This module provides a simple Image Uploader for Widgets based on the Gist from @cedricblondeau.

alt text

Installation

composer require dlambauer/magento2-module-backend-widget-imageupload

Add an Image

To add an Image, you have to add a parameter like this in your widget.xml:

<parameter name="insert_a_meaningfull_name" xsi:type="block" required="true" visible="true" sort_order="10">
    <label translate="true">Insert a Label here</label>
    <description translate="true">Add a great Description</description>
    
    <block class="Dlambauer\WidgetImageUpload\Block\Adminhtml\Widget\ImageChooser">
        <data>
            <item name="button" xsi:type="array">
                <item name="open" xsi:type="string">Choose Image...</item>
            </item>
        </data>
    </block>
</parameter>

ToDo

  • Add Unit and Integration Tests
  • Require the JS Component more pretty, so we can remove the plain html script-tag from the block

Requirements

  • PHP >= 5.5.0

Support

If you encounter any problems or bugs, please create an issue on GitHub.

Contribution

Any contribution to the development of this Module is highly welcome. The best possibility to provide any code is to open a pull request on GitHub.

Licence

GNU General Public License, version 3 (GPLv3)

Copyright

(c) 2015 David Lambauer