Creating a New CMS Page Layout in Magento

These steps create a new page in the Magento CMS…

First, create a module by creating this file: app/etc/modules/Mage_Page.xml

<?xml version="1.0"?>
<config>
<modules>
<Mage_Page>
<active>true</active>
<codePool>local</codePool>
</Mage_Page>
</modules>
</config>

Then copy this folder: app/code/core/Mage/Page to app/code/local/Mage

This takes the core module and places it into our local module so we can update it without worrying about future updates.

Now we need to edit: app/code/local/Mage/Page/etc/config.xml to add your own layout to the xml.

<contact_page module="page" translate="label">
<label>Contact</label>
<template>page/contact.phtml</template>
<layout_handle>page_contact</layout_handle>
</contact_page>

Now all you have to do is make a template for this page. Navigate to your theme directory: app/design/frontend/YOUR_THEME/YOUR_THEME/template/page/ and create a new template called contact.phtml.

Tags: , ,

About Keiron

Web Developer based in the UK. Click here if you want to work with me