Written by Steve Perry
Published on

Changing the default page template for the category view in Magento

I’ve been handed a layout to build for a Magento project which uses a 1-column layout for the catalog category view. Out-of-the-box Magento uses the 3-column layout. To change the default behaviour I added the following to my app/design/frontend/custom/default/layout/local.xml

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

I’m still getting used to how Magento handles it’s layouts using xml but the more I work with it, the more it makes sense.

Steve Perry Creative Ltd

Studio and registered office: 4 Back Lane, Brown Edge, Staffordshire ST6 8QS.

Copyright © 2012 – 2023 Steve Perry Creative Ltd., unless otherwise noted.

Registered in England & Wales, number 08354632.

Colophon

Typeset in Söhne Kräftig and Söhne Buch, by Klim Type Co.

Set as 32/64, 24/32, 20/32, and 12/16 on an 8px/96px grid.

Colour palette selected for AAA contrast.