我想在面包屑页面中显示类别名称和描述,即,app/design/frontend/default/mytheme/template/page/html/breadcrumbs.phtml
而不是app/design/frontend/default/mytheme/template/page/catalog/category/view.phtml
我设法显示类别名称,但无法显示类别说明。我在面包屑.phtml中添加了一些代码
<?php if($crumbs && is_array($crumbs)): ?>
<div>
<ul class="bradecom">
<?php foreach($crumbs as $_crumbName=>$_crumbInfo): ?>
<li class="<?php echo $_crumbName ?>">
<?php if($_crumbInfo['link']): ?>
<a href="<?php echo $_crumbInfo['link'] ?>" title="<?php echo $this->escapeHtml($_crumbInfo['title']) ?>"><?php echo $this->escapeHtml($_crumbInfo['label']) ?></a>
<?php elseif($_crumbInfo['last']): ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php else: ?>
<?php echo $this->escapeHtml($_crumbInfo['label']) ?>
<?php endif; ?>
<?php if(!$_crumbInfo['last']): ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<ul><li class="<?php echo $_crumbName ?>"><h1> <?php echo $this->escapeHtml($_crumbInfo['label']) ?></h1></li> </ul>
如果有人知道如何在此处显示类别描述,请帮帮我。
谢谢!
价格,您可以获取current category Using Registry function and Controller Name
任何类别的描述...
$ category = $ this-> getRequest()-> getControllerName();
if(Mage::registry('current_category')&& ($category == 'category')){
echo Mage::registry('current_category')->getDescription();
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句