开发者

Magento Content Block Question

Noob Question here. I have created and successfully added an additional Page Layout to the existing theme on a client's website.

I then checke开发者_如何学Cd what was going on in the content area and found that a file, named grouped.phtml was being called.

The Problem:

I want to duplicate that file and call it (for example) grouped2.phtml and add it to my custom page layout, while keeping the first file (grouped.phtml) alone. How do I do this? Thank you ahead of time.


Copy grouped.phtml from base/default/template/catalog/product/view/type/ to grouped2.phtml in the same directory of your theme. Edit it as you wish.

Open up layout/catalog.xml in your theme. Find the lines that say

   <block type="catalog/product_view_type_grouped" name="product.info.grouped" as="product_type_data" template="catalog/product/view/type/grouped.phtml">
        <block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"/>
   </block>

Duplicate those lines with your grouped2.phtml

done.

======EDIT===========

If you wish to retain the standard grouped.phtml as the default, but use your grouped2.phtml in some specific instances, you can make XML layout changes in the "Custom Layout Update" field on the Design tab of the specific products or categories in the Magento Admin. In that case, use the following XML:

<remove name="product.info.grouped"/>
<block type="catalog/product_view_type_grouped" name="product.info.alternative.grouped" as="product_type_data" template="catalog/product/view/type/grouped2.phtml">
        <block type="core/text_list" name="product.info.grouped.extra" as="product_type_data_extra"/>
   </block>

Note that the inserted XML has a different name.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜