Download the PHP package bitpolar/categoryimgwidget without Composer
On this page you can find all versions of the php package bitpolar/categoryimgwidget. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bitpolar/categoryimgwidget
More information about bitpolar/categoryimgwidget
Files in bitpolar/categoryimgwidget
Package categoryimgwidget
Short Description Bitpolar Category List with custom Thumbnail Widget
License OSL-3.0
Informations about the package categoryimgwidget
Magento 2 Widget: Category List with optional thumbnail or category image
Based on
https://github.com/studioraz/magento2-category-image
https://github.com/MageMontreal/magento2-category-list-widget
Features
- Add category list as a widget
- Manage Image Size Output
- Assign Custom Parent Category
- Or list any category
- Add and use additional thumbnail as preview image
- Images are resized and cached to the user defined sizes
- Uses the placeholder image as default
Composer Installation Instructions
composer require bitpolar/categoryimgwidget
Enable Bitpolar/CategoryImgWidget Module
to Enable this module you need to follow these steps:
-
Enable the Module
bin/magento module:enable Bitpolar_CategoryImgWidget
-
Run Upgrade Setup
bin/magento setup:upgrade
-
Re-Compile (in-case you have compilation enabled)
bin/magento setup:di:compile
How to add new category image ?
The module already creates one image field called Thumbnail.
If you need to additional image fields follow these steps:
- Create an upgrade data script to create the new category image attribute.
-
Create new upload class for the new image attribute by copy-pasting the file Controller/Adminhtml/Category/Thumbnail/Upload.php. Change the class name and the following line:
-
Add the new fields to the admin html category form at view/adminhtml/ui_component/category_form.xml and change: the field name, the label and the uploader Url
-
Add the new image attribute code to the helper class Helper/Category.php line 16
- Repeat step 4 in the Controller class Controller/Adminhtml/Category/Save.php line 18
If everything went well you should be able to see the new field on the category screen under the Content group. You should also be able to upload, save and delete the image file successfully.
How to show the new image on frontend ?
The module comes with a block that can print any new image field on the category page frontend. Just add the following XML block under the container/block you would like the image to appear.
The above block can print category images ONLY on category pages cause it assumes there is already stored category model in core registry. If you need to print the image on other pages use the following code snippet.