Magento has a few neat features that ensures it stakes its place as one of the best e-commerce platforms available. These include a super organised folder structure, a potent fallback system, and oodles of functionality.
But before you or your client gets the most out of your Magento e-commerce website, you need to first build a Magento theme. Magento themes development can be fairly easy, but to do it properly there are a few things you need to be aware of.
Magento Theme Development – from scratch!
Create Your Theme
The Magento themes development road is actually not all that long. To begin with Magento theme creation, you need to create a brand new design package in two folders:
For the purpose of this tutorial, we’re going to name our package “OurPackage”.
In your design package, you need to create a folder for your theme. We will call ours “OurTheme”.
Next, create 2 folders in the theme folder. These folders are your layout and template.
You then need to head over to the skin folder, open your theme folder and create 3 more folders:
Finally, you need one more – local.xml. Slot this in your layout folder and you’re all set.
Work With Your Theme
As good as Magento is, it still needs to be told what to do now and then. As you’re engaged in Magento theme development from scratch, you need to tell it which package and themes are your default’s.
Head on over to system > config > design.
You then need to tell it that you want to use the OurPackage design package.
Then, slot your theme name into all fields with the exception of the default field.
And that’s it! Your theme is all ready and raring to go.
But before you get too eager to start editing, let’s take a quick look at Magento’s fall back system. This is important for your Magento themes development.
Magento Fallback System
Magento’s fallback system is ridiculously powerful and gives you the chance to edit your themes without lots of duplicated files flying all over the place.
How does it work?
Well, Magento is made up of numerous small blocks which are routed to a single HTML file. If just one file is missing, you will be met with an alarming render error and your site won’t work. Oh no!
For this reason, your base package files should never be edited or deleted. Never. If one is deleted by accident, Magento won’t be able to fallback and you will be met with a render error.
If, however, your theme holds only your changed files, Magento will be able to fallback and look for their base counterparts. Which will basically save your bacon.