2014-07-10 77 views
1

我想在面包屑页面即显示类别名称和描述,在app/design/frontend/default/mytheme/template/page/html/breadcrumbs.phtml而非app/design/frontend/default/mytheme/template/page/catalog/category/view.phtml如何在magento的breadcrumb页面显示类别描述?

我设法显示类别名称,但无法显示类别描述。 我添加了一些代码breadcrumbs.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']): ?> 
      &nbsp; 
       <?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> 

如果有谁知道如何在这里展示类的描述,那么请帮助我。

谢谢!

回答

1

价格,你可以得到的current category Using Registry function and Controller Name范畴的任何地方描述...

$类= $这个 - > Request()方法 - > getControllerName();

if(Mage::registry('current_category')&& ($category == 'category')){ 
echo Mage::registry('current_category')->getDescription(); 
} 
+0

我把这个breadcrumbs.phtml,但没有说明.. –

+1

只是删除用strtolower($行动 - > getFullActionName()条件 –

+0

刚才检查.. –

相关问题