Magento Forum

   
How to show category images in cms page in Magento
 
mikejswan
Jr. Member
 
Total Posts:  9
Joined:  2013-04-05
Rochester, NY
 

I am trying to make a brand page to show all the brand images and descriptions on one page. I have created a brand category with the ID 3, all the brands go under that category, i want to show only the brand names show but the images and descriptions don’t show,

Please help me to sort out this problem, any help would be appreciated.

<?php    
    $brands 
Mage::getModel('catalog/category')->load(3)->getChildrenCategories();
?>

<?php 
foreach($brands as $brand): ?>
    
<ul>
    <
li>
        <
a href="<?php echo $brand->getUrl() ?>">
             <
img src="<?php echo $brand->getImageUrl() ?>" />
             
<?php echo htmlspecialchars($brand->getName()) ?>         
        
</a>
            
<?php echo htmlspecialchars($brand->getDescription()) ?>  
    
</li>
    </
ul>
 
<?php endforeach ?>

 
Magento Community Magento Community
Magento Community
Magento Community
 
nickcarter21
Jr. Member
 
Total Posts:  23
Joined:  2013-04-02
 

Well there is a little bit mistake in code which you use to make a brand page to show all the brand images and descriptions on one page.

You have to load the category from catalogue to show images and description-

$catMage::getModel('catalog/category')->load($brand->getId());

Let me clear you with full code :

<?php    
    $brands 
Mage::getModel('catalog/category')->load(3)->getChildrenCategories();
?>
<?php 
foreach($brands as $brand): ?>
<?php
    $cat
Mage::getModel('catalog/category')->load($brand->getId());
?>
    
<ul>
    <
li>
        <
a href="<?php echo $cat->getUrl() ?>">
             <
img src="<?php echo $cat->getImageUrl() ?>" />
             
<?php echo htmlspecialchars($cat->getName()) ?>         
        
</a>
            
<?php echo htmlspecialchars($cat->getDescription()) ?>  
    
</li>
    </
ul>
 
<?php endforeach ?>

Hope you got your answer or still i need to explain it more.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MagikSwapna
Sr. Member
 
Total Posts:  97
Joined:  2010-12-14
 

Hello,

Try following code to display category image and description.

<img src="<?php echo Mage::getBaseUrl('media').'catalog/category/'.$brand->getImage()  ?>" />
<?php echo $brand->getDescription() ?>

Hope this will help you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
walice0127
Jr. Member
 
Total Posts:  2
Joined:  2013-12-12
 

Quite useful information and guide for me,thanks for sharing.
http://www.rs3pal.com/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Christinale
Sr. Member
 
Total Posts:  88
Joined:  2013-12-11
 

hi, there are a lot of magento lessons4, you can read in this link http://blog.magestore.com/category/magento-training/.

Maybe it helps you something. If there is no lesson about your problem, you can see them email to ask for this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sarah369
Jr. Member
 
Total Posts:  2
Joined:  2014-01-02
 

This web image viewing SDK supports high speed web document & image viewing, processing and annotating. It can be integrated with all the mainstream browsers. You can also choose a Windows image viewer to display and show category images.

 
Magento Community Magento Community
Magento Community
Magento Community
 
christinavick
Sr. Member
 
Total Posts:  265
Joined:  2013-11-13
 

Hi,

You can also check this thread for this http://magento.stackexchange.com/questions/6417/show-category-thumb-image-on-startpage

Thanks

iLoveMage

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top