PHPackages                             studioraz/magento2-category-image - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. studioraz/magento2-category-image

ActiveMagento2-module

studioraz/magento2-category-image
=================================

Magento 2 module to add extra category images

2.0.1(11mo ago)2411.6k↓29.2%14OSL-3.0PHP

Since Nov 29Pushed 11mo ago5 watchersCompare

[ Source](https://github.com/studioraz/magento2-category-image)[ Packagist](https://packagist.org/packages/studioraz/magento2-category-image)[ RSS](/packages/studioraz-magento2-category-image/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

Magento 2 Category Image Module
===============================

[](#magento-2-category-image-module)

#### Purpose

[](#purpose)

Creating a new category EAV attribute is not simple as creating a new product EAV attribute.

This module comes to answer this complexity by allowing the developer to follow a few simple steps in order to create new category images.

#### How to add new category image ?

[](#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:

1. Create an upgrade data script to create the new category image attribute.
2. 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:

```
  $result = $this->imageUploader->saveFileToTmpDir('{image-attribute-code}');
```

3. 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

```

                    string
                    category
                    {Image Label}
                    true
                    fileUploader
                    ui/form/element/uploader/uploader
                    Magento_Catalog/image-preview
                    false
                    41

```

4. Add the new image attribute code to the helper class **Helper/Category.php** line 16

```
public function getAdditionalImageTypes()
    {
        return array('thumbnail', '{image-attribute-code}');
    }
```

5. Repeat step 4 in the Controller class **Controller/Adminhtml/Category/Save.php** line 18

```
protected function getAdditionalImages() {
        return array('thumbnail', '{image-attribute-code}');
}
```

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 ?

[](#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.

```

        {image-attribute-code}
        {div-css-class}

```

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.

```
$category = 'load a category model class here'; // the decision how to load category model object is up to you.
$helper    = $this->helper('SR\CategoryImage\Helper\Category');
$imageUrl = $helper->getImageUrl($category->getData('image-attribute-code'));
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance51

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~402 days

Recently: every ~209 days

Total

6

Last Release

347d ago

Major Versions

0.0.4 → 1.0.02024-03-18

1.0.0 → 2.0.02024-05-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bfa52434a9977959b38e23769e70eedf6ceeade2d12daf7ee1f243b46b47ce7?d=identicon)[itaymesh](/maintainers/itaymesh)

---

Top Contributors

[![itaymesh](https://avatars.githubusercontent.com/u/493197?v=4)](https://github.com/itaymesh "itaymesh (5 commits)")[![rlapko](https://avatars.githubusercontent.com/u/56867555?v=4)](https://github.com/rlapko "rlapko (5 commits)")[![chrisastley](https://avatars.githubusercontent.com/u/400344?v=4)](https://github.com/chrisastley "chrisastley (2 commits)")[![MaxMage](https://avatars.githubusercontent.com/u/35223992?v=4)](https://github.com/MaxMage "MaxMage (2 commits)")[![cainan-paradoxlabs](https://avatars.githubusercontent.com/u/90711292?v=4)](https://github.com/cainan-paradoxlabs "cainan-paradoxlabs (1 commits)")

### Embed Badge

![Health badge](/badges/studioraz-magento2-category-image/health.svg)

```
[![Health](https://phpackages.com/badges/studioraz-magento2-category-image/health.svg)](https://phpackages.com/packages/studioraz-magento2-category-image)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
