0
votes

I am trying to add Category image at the top of my category landing page. I am using luxury theme and magento 1.9 version

What i have done so far: I have added image in Admin -> manage categories -> My Category -> in general information tab I added image

Next I tried to change code in page/html/Breadcrumbs.phtml but it didn't work

This is default code in page/html/Breadcrumbs.phtml

<?php if($crumbs && is_array($crumbs)): ?>

    <?php
        $bg_image = $this->getLayout()->createBlock('cms/block')->setBlockId('luxury-background-breadcrumbs')->toHtml();
        preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $bg_image, $matches);     
    ?>
<div class="breadcrumbs" <?php if($matches[1][0] !=''): ?>style="background-image:url(<?php echo $matches[1][0]?>);"<?php endif;?>>
</div>

Help in how to display image to the top(header) of the page.

Is there any way to just get the image of the categories?

3
Have you done some googling?Kingshuk Deb
Inside Manage Categories add it in the Image attribute. It should come as a banner in your category landing page by default.Kingshuk Deb
Yes I did googled I did add it in the image attribute but it is not displaying in the category landing pageparish
Can you show us the category view page code..not the listing pageKingshuk Deb

3 Answers

0
votes
Go to your catalog->category->view.phtml page search for $_imagHtml if not found use this below code in your file 
<?php $_imgHtml   = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" /></p>';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
    }?>
<?php if($_imgUrl): ?>
    <?php echo $_imgHtml ?>
<?php endif; ?>
0
votes

A code free way to achieve this that can be done entirely from the admin side of your Magento installation. For each category you want to load an image for, create a static cms block (cms->static blocks->add new block) and place the html image tag for your desired category image inside it. Give it a nice obvious name like (for the sake of example) Category23_Image_block.

Now edit the properties of your category, and go to the design tab. Set "Display Mode" to "static block and products" and select your new static block from the "CMS Block" dropdown.

This should now place the block containing your desired image directly at the top of your category landing page.

0
votes

google this where does magento store category images?

public_html/media/catalog

after you have worked out where the images are stored go to Cpanel and find them

look at the permissions and you will probably see that the permissions are set to 640

change the permission to 644 and save

refresh your front end page and the image should be there