Magento 1.7.0.2 - 显示左侧2列以上的图像类别

Ale*_*lex 1 magento magento-1.6 magento-1.7

我的类别产品页面具有以下布局:左侧边栏为2列.

当我设置我的类别图像时,它只在1列(类别页面)中上升.

如何使类别图像位于列,类别页面和侧边栏之上?

小智 5

类别横幅(图片)来自template/catalog/category/view.phtml于此

$_imgHtml   = '';
if ($_imgUrl = $_category->getImageUrl()) {
  $_imgHtml = '<div class="category-image-container"><div class="category-image-container-inner"><p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p></div></div>';
    $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}
Run Code Online (Sandbox Code Playgroud)

首先评论这个

然后在和template/page/2columns-left.phtml之间<div class="main"><div class="col-left"><?php echo $this->getChildHtml('left') ?></div>

写下类别横幅代码

<?php   
        $_category  = Mage::registry('current_category');
        if($_category){
         $_helper    = Mage::helper('catalog/output');

            $_imgHtml   = '';
            if ($_imgUrl = $_category->getImageUrl()) {
           echo   $_imgHtml = '<div class="category-image-container1"><div class="category-image-container-inner"><p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->htmlEscape($_category->getName()).'" title="'.$this->htmlEscape($_category->getName()).'" /></p></div></div>';
                $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
            }
        }
        ?>
Run Code Online (Sandbox Code Playgroud)

这将显示左列上方的类别横幅和内容.