2014-07-10 76 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

剛纔檢查.. –

相關問題