Magento Forum

   
Category Custom Layout Update XML not working at all
 
wackget
Jr. Member
 
Total Posts:  2
Joined:  2013-11-06
 

I want to replace the product_list block for a certain category with a custom template (list_custom.phtml).

To do this, I thought I could use the following XML in the Custom Layout Update of my target category:

<reference name="product_list">
    <
action method="setTemplate"><template>catalog/category/list_custom.phtml</template></action>
</
reference>

I reindex category_flat_data (and caching is disabled) but nothing happens. Other update code such as <remove name="product_list" /> works fine, but the product_list template just won’t update.

The product list block is specified in catalog.xml and when I edit it there the changes are reflected on every category on the site. However, editing catalog.xml is not an option as I only want the custom template to be used on a few specific categories.

I’ve posted on StackOverflow about this issue too.

What am I doing wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
wackget
Jr. Member
 
Total Posts:  2
Joined:  2013-11-06
 

I’ve still been unable to solve this. Does anybody have any idea?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kmHelms
Sr. Member
 
Total Posts:  221
Joined:  2012-03-05
 

I don’t know if this is the best way to do it, but it works. Copy and paste the entire reference section from catalog.xml into your layout update with your new template file. So, in your case, paste this whole thing

<reference name="content">
            <
block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <
block type="catalog/product_list" name="product_list" template="catalog/category/list_custom.phtmll">
                    <
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"/>
                        <!-- 
The following code shows how to set your own pager increments 
                            
<action method="setDefaultListPerPage"><limit>4</limit></action>
                            <
action method="setDefaultGridPerPage"><limit>9</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
                            <
action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
                        -->
                    </
block>
                    
                                                                 
                    <
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>
                    
                    <
action method="setColumnCount"><count>4</count></action>
                    
                </
block>               
                
            </
block>
        </
reference>

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top