Add custom layout in CMS page

October 25, 2010 15:55

You may design some nice templates and layouts for your Magento shopping cart, but you cannot choose these layouts in CMS.

You can add the following XML codes in “global” section in either one of config.xml in any module, but I suggest you to create a new custom module to change it.

For example, if you’ve added a new layout named “Two-Column Right Column Full Layout Pages” in “page.xml”:

    <page_two_columns_right_full translate="label">
        <label>Two-Column Right Column Full Layout Pages</label>
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right-full.phtml</template></action>
            <!-- Mark root page block that template is applied -->
            <action method="setIsHandle"><applied>1</applied></action>

Then in the config.xml in a new custom module or a existing module:

            <two_columns_right_full module="page" translate="label">
                <label>Two-Column Right Column Full Layout Pages</label>

Then in your backend CMS page, you should be able to choose this new layout.

Happy Magento’ing ~


Comments are closed.