Setting:
- Using Magento 1.9
- My Default template is
2column_left
set at mylocal.xml
(as shown below)
My categories are as follows and isAnchor=No
:
Top1
Sub1-Top1
Sub1-Sub1-Top1
Sub2-Top1
Sub3-Top1
Sub1-Sub3-Top1
Top2
Sub1-Top2
Sub2-Top2
Sub1-Sub2-Top2
Scenario:
I would like the layout for Sub2-Top1 and Sub1-Top2 (no subcategories) to have the 1column
template and the rest should have the 2column_left
. But I cannot seem to get it correctly.
I was trying to accomplish this task from the examples:
- layout - call left column block within main column (in the 1column.phtml template)
- and https://stackoverflow.com/questions/9763350/how-to-change-the-page-layout-in-magento
local.xml
<ep_catalog_category_template>
<reference name="root">
<action method="setTemplate">
<template>page/2columns-left.phtml</template>
</action>
</reference>
</ep_catalog_category_template>
<ep_no_catalog_category_template>
<reference name="category.products">
<action method="setTemplate">
<template>page/1column.phtml</template>
</action>
</reference>
</ep_no_catalog_category_template>
<catalog_category_layered>
<update handle="ep_catalog_category_template" />
</catalog_category_layered>
<catalog_category_default>
<update handle="ep_catalog_category_template" />
</catalog_category_default>
<catalog_category_layered_nochildren>
<reference name="category.products">
<action method="setTemplate">
<template>page/1column.phtml</template>
</action>
</reference>
</catalog_category_layered_nochildren>
The catalog_category_layered_nochildren
tag should replace the default template to 1column
but it is not working. Instead the output page is 2column
with the left side contains no content and the main content has the list of products. I would like the list of products to use all the page -- thus removing the left_column
ergo 1column
. Can it be done using local.xml
? or better yet, how can I do this?
Under Catalog -> Manage -> Categories ->Custom Design Tab -> Page Layout
change the layout to 1column. But still looking for a way to do it using local.xml.