I've been stuck with this for few day's now and can't understand why the category image is not retrieved by magento.
I've added this page_header.phtml
to the template/page/html
folder with the following html:
<?php
$_helper = Mage::helper('catalog/output');
$_category = Mage::registry('current_category');
$_imgUrl = $_category->getImageUrl()
?>
<?php
if (!$_imgUrl){
?>
<script type="text/javascript">
jQuery(function($){
$(".top-container").addClass("no-image");
});
</script>
<?php
}
?>
<div class="bgback" style="<?php if($_imgUrl): ?>background-image: url(<?php echo $_imgUrl; ?>);<?php endif; ?>">
<div class="container page-header-area">
<div class="left-area">
<?php echo $this->getChildHtml("breadcrumbs"); ?>
</div>
<div class="category-top-title">
<h1><?php echo $_helper->categoryAttribute($_category, $_category->getName(), 'name') ?></h1>
</div>
</div>
</div>
<div class="zn_header_bottom_style"></div>
Then went to the local.xml
and added this:
<catalog_category_view>
<reference name="top.container">
<block type="core/template" name="page.header" template="page/html/page_header.phtml">
<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</block>
</reference>
</catalog_category_view>
It show's up correctly on the category pages, but the issue is that the image is not being displayed and I can't figure out why.
The folder's on the server media
and var
has 777 permisions. The image is uploaded in the backend. Did I forget something?
Thanks guys,