1

I require some assistance on Magento 1.14. I am currently coding a new theme for a an existing Magento website and require the Catalog layouts all to be 1 column as opposed to the default "2 Columns With Left".

When I change the "page layout" under one of the categories it changes on the front-end as you would expect. However I don't want to have to go through each category and set these to 1 column.

I have tried an override in local.xml file but this doesn't seem to affect anything, please could someone advise. This is the code I added to the local.xml file

<catalog_category_view> <reference name="root"> <action method="setTemplate"> <template>page/1column.phtml</template> </action> </reference> </catalog_category_view> 

Regards

2
  • did you clear a cache? Commented Jul 13, 2015 at 14:28
  • Yep! All caching is disabled and also to double check I removed the files manually Commented Jul 13, 2015 at 14:32

2 Answers 2

1

The XML is correct, I have exactly the same and it works:

<?xml version="1.0"?> <layout> <catalog_category_view> <reference name="root"> <action method="setTemplate"> <template>page/1column.phtml</template> </action> </reference> </catalog_category_view> </layout> 

What you should check now:

  • Clear the Magento cache
  • Is the local.xml actually used? It should be in the layout directory of the currently configured theme. A quick and easy way to find out if the file is used, is to add some invalid XML like <<< at the end and see if the site breaks.
  • Are the categories explicitly set up to use the Two Column layout? It should look like this ("No layout updates"):

    Screenshot of category configuration


What you should also know is that the there are two different layout handles for anchor categories (i.e. with layered navigation) and non-anchor categories, so that you can apply updates to only one of these instead to catalog_category_view:

  • catalog_category_default
  • catalog_category_layered
6
  • Is it possible that this could have been overwritten elsewhere? The local.xml file is definitely being used, I did have some errors in a template but even now these have been cleaned up the template still doesn't change. Commented Jul 13, 2015 at 14:51
  • Since local.xml is always the last layout file that gets merged, it could only be overridden in the same file, in the settings for each category itself or somewhere in custom code. Commented Jul 13, 2015 at 15:00
  • Sorry, you mention, "in the settings for each category itself" would you be referring to this setting: here Commented Jul 13, 2015 at 15:04
  • Yes. This should be "no changes", otherwise it takes precedence over anything from the layout XML Commented Jul 13, 2015 at 15:06
  • I see, and theres no way to 'globally override' this setting? Commented Jul 13, 2015 at 15:07
1

Are you 100% sure that your local.xml is used? Then try to also set the template for the more specific layout handles catalog_category_default and catalog_category_layered:

<catalog_category_default> <reference name="root"> <action method="setTemplate"> <template>page/1column.phtml</template> </action> </reference> </catalog_category_default> <catalog_category_layered> <reference name="root"> <action method="setTemplate"> <template>page/1column.phtml</template> </action> </reference> </catalog_category_layered> 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.