mons / magento-widget
Useful widget parameter types for page building in Magento 2
Installs: 633
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:magento2-module
Requires
- php: ~8.1.0
- magento/framework: 103.0.*
- magento/module-cms: 104.0.*
- magento/module-widget: 101.2.*
This package is auto-updated.
Last update: 2024-12-08 19:50:49 UTC
README
Adds new parameter types for improved widget definition experience in Magento 2.
Parameter types
- Image selector field
- Textarea field
- Wysiwyg field
- Repetable fields (in progress)
Installation
- Install module via composer
composer require mons/module-m2-widget
- Register module
php bin/magento setup:upgrade
Usage examples
Image Selector
<parameter xsi:type="block" name="background_image" visible="true" sort_order="10"> <label translate="true">Background Image</label> <block class="Mons\Widget\Block\Adminhtml\Widget\Type\ImageChooser"> <data> <item name="button" xsi:type="array"> <item name="open" xsi:type="string">Choose Image...</item> </item> </data> </block> </parameter>
Textarea
<parameter xsi:type="block" name="body_text" visible="true" sort_order="10"> <label translate="true">Body Text</label> <block class="Mons\Widget\Block\Adminhtml\Widget\Type\Textarea" /> </parameter>
Wysiwyg
<parameter xsi:type="block" name="body_text" visible="true" sort_order="10"> <label translate="true">Body Text</label> <block class="Mons\Widget\Block\Adminhtml\Widget\Type\Wysiwyg"> <!-- optional TinyMCE config --> <data> <item name="toolbar" xsi:type="string">bold italic underline</item> <item name="plugins" xsi:type="string">link</item> </data> </block> </parameter>
Tested working with
- Magento 2.4
- PHP 8.1
Contribution
- Fork this repository
- Create your feature branch (
git checkout -b feature/your-new-feature
) or a bugfix branch (git checkout -b bugfix/bug-short-description
) always fromdevelop
- Commit and submit a new Pull Request