Uses of this functionality may vary, but we find it inevitable that you need to add your own CMS template to magento. Most often we need to do this to add a custom homepage template which typically has a very different layout to the rest of your shop. Short of putting everything into your CMS page itself which can be messy and make it easy to break a page we would recommend any non-cms content/functionality be put in the template (You could always call in some less frequently edited pieces of content via a few static blocks).

So, we’ll start with the standard module XML file:

<?xml version=”1.0″?>
<config>
<modules>
<Designthatfits_Newtemplates>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Page />
</depends>
</Designthatfits_Newtemplates>
</modules>
</config>

And set up our file/folder structure within app/code/community:

  • Designthatfits/Newtemplates/etc/config.xml
And in the template folder: /app/design/frontend/default/yourtheme/template/page/home.phtml

Adding a new page template is probably one of the most basic extensions and only requires the following within the config.xml file:

<?xml version=”1.0″?>
<config>
<modules>
<Designthatfits_Newtemplates>
<version>0.1.0</version>
</Designthatfits_Newtemplates>
</modules>
<global>
<page>
<layouts>
<home translate=”label”>
<label>Home</label>
<template>page/home.phtml</template>
<layout_handle>page_home</layout_handle>
</home>
</layouts>
</page>
</global>
</config>

By placing your new templates withing the <layouts> section you define a) the location of the template file, b) it’s name, c) it’s handle.

The final task is to fill your phtml file with the relevant content. Refresh your cache and indexes and you should then be able to access the new template when creating your CMS page.

Ecommerce Shipping Strategies - Website Options
E-commerce
David Pratt

Ecommerce Shipping Strategies

Ecommerce Shipping Strategies are an important thing to consider when running an ecommerce business. It can mean the difference between a conversion and an abandoned basket.
Read More »
E-commerce
DTF Digital

Temu eCommerce

Temu eCommerce has seen rapid growth recently, but will it fly or fail? Will the temptation of low cost goods direct from the manufacturer in China win over ethical considerations of low cost labour and carbon footprint?
Read More »
DTF Digital