2012-01-25 68 views
4

如果我要控制每個產品顯示(即指定一個自定義設計)我首先想到的是要做到這一點:Magento的:通過產品specfic設計「定製佈局更新」

  1. 創建自定義view.phtml模板/目錄/產品/ my_view.phtml
  2. 導航在管理員產品 - >設計 - >自定義佈局更新
  3. 添加塊:

<reference name="content"> 
    <action method="setTemplate"> 
     <template>catalog/product/view_print.phtml</template> 
    </action> 
</reference> 

但絕不會在加載的模板,只有默認view.phtml。這是正確的方法嗎?我需要能夠在產品設置中執行此操作。

+0

你應該把你的意見作爲一個答案,並將其標記爲接受的答案,誰是有可以在同一問題的方式其他人更輕鬆地找到你的答案。這是[鼓勵SO](http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/) – CCBlackburn

回答

10

找到了答案:

<reference name="product.info"> 
    <action method="setTemplate"><template>catalog/product/NEW_VIEW.phtml</template></action> 
</reference> 
-1

導航在管理員產品 - >設計 - >自定義佈局更新>
添加下面的自定義塊。 >適用於所有商店。

"<reference name="product.info"> 
     <block type="namespace_modulename/catalog_product_list_custom" 
    name="catalog.product.modulename" as="modulename" after="tierprices" 
    template="modulename/catalog/product/modulename.phtml"/> 
</reference> " 

加入下面的代碼view.phtml

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