[英]magento 1.9 Which layout XML file specifies which list.phtml file will show a list of subcategories within a category?
[英]Magento: Call custom phtml in list.phtml via XML
在Magento中,我試圖在list.phtml中顯示一個phtml自定義模塊。 我的xml看起來像這樣:
<catalog_category_default>
<reference name="content">
<block type="my_prevenda/prevendalist" name="prevenda" as="prevenda" template="prevenda/prevenda_list.phtml" />
</reference>
</catalog_category_default>
我這樣叫: <?php echo $this->getChildHtml('prevenda') ?>
但是此方法只能在view.phtml中進行。 如何顯示在list.phtml中? 將保留產品名稱
我Tks所有!
<?xml version="1.0"?>
<layout>
<catalog_category_default>
<reference name="product_list"><!-- need to add to the correct parent block -->
<block type="my_prevenda/prevendalist"
name="prevenda" as="prevenda"
template="prevenda/prevenda_list.phtml" />
</reference>
</catalog_category_default>
</layout>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.