Magento - Custom Page/CMS Templates
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:
And set up our file/folder structure within app/code/community:
Adding a new page template is probably one of the most basic extensions and only requires the following within the config.xml file:
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.
The importance of marketing automation
Magento 2 SSH commands if using plesk
Businesses can trust us to deliver effective online marketing solutions. Find out why.Speak to an expert