开发者

How to call a core template in magento

开发者 https://www.devze.com 2023-01-16 11:40 出处:网络
I am new to Magento开发者_JAVA技巧, and I have created list1.phtml in Magento with some changes to the file list.phtml. My problem is that I want to call list1.phtml like list.phtml. Icopied the code

I am new to Magento开发者_JAVA技巧, and I have created list1.phtml in Magento with some changes to the file list.phtml. My problem is that I want to call list1.phtml like list.phtml. I copied the code of list.phtml from catalog.xml and created a new content block for list1.phtml but it doesn't work for me. Please help.

Actually, I want a page in Magento that only shows 5 product rows, and all other pages are the same with 3 products. I am overriding list.phtml to list1.phtml according to my needs but it doesn't work for me.

Sorry for my English.

Thanks in advance,

-Jeet


One option would be to create a new template by creating a new folder inside /app/design/frontpage/default. Copy the list.phtml there keeping the directory structure intact. Then choose this newly created template in the custom design section for the category that you want this custom list.phtml to apply to.

Let me know if any of the above requires more clarification and I will be more than happy to help you out further.


             <reference name="content">     
        <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">    
            <block type="catalog/product_list1" name="product_list1" template="catalog/product/list1.phtml">
                <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                    <block type="page/html_pager" name="product_list_toolbar_pager"/>
                </block>
                 <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
            </block>
        </block>
    </reference>          
    <!--CODE END-->


If you created core template named in catalog directory with name test.phtml. Use:

<reference name="content">
<block type="core/template" name="tesitng"  template="catalog/test.phtml"/>
</reference>

:) Hope this works

0

精彩评论

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

关注公众号