to add categories along with images on homepage
just add the code given below to your homepage from admininstration cms management.
{{block type="catalog/navigation" name="catalog.category" template="catalog/category/list.phtml"}}
Also you need to create a list.phtml file under “/app/design/frontend/default/default/template/catalog/category/list.phtml”
and add the below given code to it:
===========================================
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>
<div style="float: left; padding-right: 30px; text-align: center;">
<div class="linkimage">
<p>
<a href="<?php echo $this->getCategoryUrl($_category)?>">
<img src="<?php echo $immagine ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" width="135" height="135" />
<?php echo $_category->getName()?>
</a>
</p>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
================================================
hi samsami2u
really thanks 😀
i need your [personal mail id] thanks lot
sure, its samsami2um@gmail.com
hey sam,
i need an help, i am using a Cms page as my home page for this i created an layout file in this file the container portion is static, where i putted a link to another CMS page where i want to show Category listing…as per iphone theme,,but on link it goes to that page but not showing anything in content,,,,,so how can i show Category listing in an CMS page???
if u can add me Gtalk…..pls addd
Hi,I an new in Magento.i have followed your given instruction but a not get success.
Please help where i make changes for display category on home page.
What can we do wrong. We made the file and added {{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/list.phtml”}}
But there is nothing to see. No errors either
okay, if you have you work online
give me a link to that so i can see what i can do
Did you ever figure out the problem? it isn’t showing up for me either, the code looks fine though…
I agree,For me it’s not working
Same problem here. not showing up anything…
put the debug mode on, may be some issue in copying the code
Thanks,
Works perfectly.
Grtz
Just add this code, but I think it’s only applicable for the “head” categories and not the sub categories. I have my navigation under the producten page. Is it possible to show the sub categories on the homepage?
Grtz,
Erwin
Hi, thanks for this code, it works well. But i would like to add a static bloc between the homepage text and the {{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/list.phtml”}}, and a static bloc with css design, how to do it??
For all who is seeking a real answer
this is your php file save it in “/app/design/frontend/default/default/template/catalog/category/Your_file_name.phtml”
getCurrentCategory();
$collection = Mage::getModel(‘catalog/category’)->getCategories($_category->entity_id);
$helper = Mage::helper(‘catalog/category’);
?>
{{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/list.phtml”}}
getIsActive()):?>
load($cat->getId());
$_img = $cur_category->getImageUrl();
?>
<a href="getCategoryUrl($cat);?>”>
<img src="” title=”$cat->getName()”/>
getName();?>
and you may call it from placing the following line in editor
{{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/Your_file_name.phtml”}}
Does anyone know whether this is still applicable for Magento CE v.1.4.1.1
Any feedback greatly appreciated. Cheers 😉
It doesn’t work for me either oin 1.4 version. Can anybody tell me the reason.
Did anyone get either of these techniques working in 1.4.2? I’m getting nothing on my cms page.
Are you sure you have images set up for your categories? The following condition is clipping out categories w/o images:
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
Replace it with
$immagine = $this->getCurrentCategory()->getImageUrl();
and remove endif; in order to display all categories regardless if they have images or not. Also the following line is useless:
isCategoryActive($_category); ?>
Looks like wp.com is clipping some code parts.
Yes, we were able to do this. Check this module:
http://shop.spletnisistemi.si/modul-custom-category-images-magento.html?___store=english&___from_store=slovenian
I doesn’t work for me , Rocky its page not found
Samsami2u , please make it clear that do we need to create any static block ,
Please reply i am new to the magento
Thanks
work for me:
Thanks a lot, mate!
What if you have a custom template? E.g. i’ve made a custom template for Magento, and its called trex. The file for the list will be found in app/design/frontend/default/trex/template/catalog/list.phtml right? Do i have to change anything so the code below calls for the catalog/category/list.phtml in the trex template?
{{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/list.phtml”}}
you can use our free Magento Easy Catalog Images Module http://www.magentocommerce.com/magento-connect/magento-easy-catalog-images.html
I have follw your step but categorie images not display…..
superb…..
Hello, Samsami2u,
I’m using the above code to get the image from my active category on the homepage.
I would like to know if i can show the “active from date” and “active till date” as well. I’ve tried to put in this getCustomDesignTo()?> instead of the getName()?> .
I’ve got no errors but it isn’t showing.
Can you give me some advise?
Thanks!
It’s not working!
thank for your work but I have a problem: my block is blank. Ow can I solve please? thank you very much
its works thank you very very very much!
Hi it works perfectly on magento 1.7.0.2 the only question I have is:
what if I want to display a custom picture instead of the category?
Thank you
Thanks , the code is working , but on home all category images are showing same. Please guide me.
http://acswebdevelopment.com/acs/Projects/2222_acutrack/magento/
Sheetal
Hi,
Could you please elaborate where exactly this line of code should go in ?
{{block type=”catalog/navigation” name=”catalog.category” template=”catalog/category/list.phtml”}}
I am a newbie to magento as well as php.
Thanks in advance
For those whom it is not working, its been like 4 years since I have posted this article. Since then magento has changed a lot and also I have not been working with magento. If you have some specific issue I can help you with investing my personal time.