2016-09-02 8 views
1

xmlを使用してのみカテゴリページに.phtmlテンプレートファイルを追加します。同じカテゴリのページで、magento-1.9でテンプレートファイルの現在のカテゴリのイメージを取得する方法は?

私は以下のコードを試しましたが、成功を記録しました。

<catalog_category_default> 
    <reference name="header"> 
     <block type="catalog/category_view" as="catalog_category_banner" name="catalog.category.banner" template="catalog/category/category-header.phtml"/> 
    </reference>   
</catalog_category_default> 

header.phtmlファイルには、以下の行があります。事前に

<?php echo $this->getChildHtml('catalog_category_banner'); ?> 

おかげ

答えて

0
<default> 
    <reference name="header"> 
     <block type="catalog/category_view" as="catalog_category_banner" name="catalog.category.banner" template="catalog/category/category-header.phtml"/> 
    </reference>   
</default> 

in header.phtml use $this->getChildHtml('catalog_category_banner'); 
関連する問題