我想在左侧边栏中显示类别描述,而不是在主列中显示。
我将此添加到我的catalog.xml中:
<reference name="left">
<block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
</reference>
<reference name="left">
<block type="catalog/navigation" name="catalog.catdes" after="catalog.leftnav" template="catalog/navigation/description.phtml"/>
</reference>
我创建了这个文件:catalog/navigation/description.phtml
<?php
$_helper = $this->helper('catalog/output');
$_category = $this->getCurrentCategory();
?>
<?php if($_description=$this->getCurrentCategory()->getDescription()): ?>
<div class="category-description">
<?php echo $_helper->categoryAttribute($_category, $_description, 'description') ?>
</div>
根本没有结果。我可能做错了什么?
最佳答案
以下为我解决了这个问题。
echo Mage::getModel('catalog/layer')->getCurrentCategory()->getDescription();
关于magento - Magento:如何在左侧边栏中显示类别说明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16398037/