2012-06-27 15 views
1

我做了一個簡單的自定義模塊,將評論放置在產品頁面上(而不是像默認鏈接到新頁面) 。Magento - 評論版面模板位置變化鏈接(summary_short.phtml)在目錄頁

產品頁面上的所有內容都正常工作。目錄頁面上的鏈接不是。這仍然鏈接到「審閱頁面」,而不是像它應該的產品頁面。這是因爲我似乎無法觸發佈局模板位置更改爲我的自定義XML佈局文件中的summary_short.phtml。

這是我的佈局文件內容:

<?xml version="1.0" encoding="UTF-8"?> 
<layout version="0.1.0"> 

<default> 
    <reference name="head"> 
     <action method="addItem"><type>skin_css</type><name>css/reviews.css</name></action> 
    </reference>  
</default> 

<!-- This works great --> 

<catalog_product_view>    
    <reference name="content">  
     <reference name="product.info"> 
      ... 
      <action method="addReviewSummaryTemplate"><type>default</type><template>productpagereviews/review/helper/summary.phtml</template></action> 
      <action method="addReviewSummaryTemplate"><type>short</type><template>productpagereviews/review/helper/summary_short.phtml</template></action> 
     </reference> 
    </reference> 
</catalog_product_view> 

<!-- Below does not work at all --> 

<catalog_category_default> 
    <reference name="content"> 
     <reference name="product_list"> 
      <action method="addReviewSummaryTemplate"><type>default</type><template>productpagereviews/review/helper/summary.phtml</template></action> 
      <action method="addReviewSummaryTemplate"><type>short</type><template>productpagereviews/review/helper/summary_short.phtml</template></action> 
     </reference> 
    </reference> 
</catalog_category_default> 
</layout> 

回答

1

我討厭回答我的問題我問它 - 宕吧!無論如何,我會發布答案,以便其他人可以知道他們是否有問題。

原來我需要一個不同的主句柄。正確的是這個catalog_category_layered。我仍然在那裏留下了「默認」標籤,因爲我不確定爲什麼這個標籤可以工作,並且catalog_category_default沒有。如果有人能回答,我會很感激!

代碼完成(大塊)將是如下:

<catalog_category_layered> 
    <reference name="product_list"> 
     <action method="addReviewSummaryTemplate"><type>short</type><template>productpagereviews/review/helper/summary_short.phtml</template></action> 
    </reference> 
</catalog_category_layered> 

現在一切都按完全按照預期!時間對於一些更多的測試....