2013-04-08 60 views
1

我的类别产品页面具有此布局:2栏与左边栏。Magento 1.7.0.2 - 显示图片类别上面2栏左页

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

我该如何让类别图像在列,类别页面和侧栏上方显示?

+0

有谁知道? – Alex 2013-04-08 19:54:55

+0

该图像加载在主模板内部的'template/catalog/category/view.phtml'中。您可以使用一些CSS定位技巧将图像移动到主列之外,或者您可以修改“template/page/2columns-left.phtml”以加载类别对象,并在那里检索图像。 – Axel 2013-04-08 21:32:46

回答

5

类别旗帜(图)来自template/catalog/category/view.phtml这样

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

写类别横幅代码

<?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'); 
      } 
     } 
     ?> 

$_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'); 
} 

首评

这将显示左栏上方的分类横幅和内容。

+0

是的,这是完美的。谢谢:) – Alex 2013-04-09 06:35:24

+0

我很高兴我能帮你:) – Leo 2013-04-09 22:37:39

相关问题