2026 Executive BenchmarkMid-Market Enterprise Modernization: How leaders across unify Commerce, Odoo ERP & AI in 90 days.
MAGENTO COMMERCE

Magento Post :

How to Call Category’s Subcategory in Particular Category. Create CMS Block in Magento. Here call your brand.phtml file. Like Below Code. ->addAttributeToSelect(array('name', 'thum...

Akshar Group Technologies
Dec 25, 2020
1 min read
Verified Source

How to Call Category's Subcategory in Particular Category. Create CMS Block in Magento. Here call your brand.phtml file. Like Below Code.

php
<?php
{{block type="catalog/product" template="catalog/product/brand.phtml"}}
After this call this block in Category.
And Put Below Code in brand.phtml file.
getCurrentCategory();
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
?>
<a href="getUrl() ?>"><img class="lazyload" decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-orig-src="getThumbnail() ?>" width="2
{{block type="catalog/product" template="catalog/product/brand.phtml"}}
After this call this block in Category.
And Put Below Code in brand.phtml file.
getCurrentCategory();
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
?>
{{block type="catalog/product" template="catalog/product/brand.phtml"}}
After this call this block in Category.
And Put Below Code in brand.phtml file.
getCurrentCategory();
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
?>
" height="2
{{block type="catalog/product" template="catalog/product/brand.phtml"}}
After this call this block in Category.
And Put Below Code in brand.phtml file.
getCurrentCategory();
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
?>
{{block type="catalog/product" template="catalog/product/brand.phtml"}}
After this call this block in Category.
And Put Below Code in brand.phtml file.
getCurrentCategory();
$categories = $category->getCollection()
->addAttributeToSelect(array('name', 'thumbnail'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($category->getChildren())
?>
" alt="htmlEscape($category->getName()) ?>" />
?>
getName() ?>

After this you see your Category's Subcategories name and image Display in your category.
Share this playbook
LET'S BUILD WHAT'S NEXT

What's Holding Your Business Back?

Tell us where you want to go, what's getting in the way, and we'll help you figure out the technology to get there.

No sales pitch. Confidential strategic advisory.