So you’ve bagged a cool Magento project and came up with a great design. You’re itching to start slicing your png/psd and dicing up the Modern theme in app/design/frontend/default/modern/ because it’s already got the right layout for the most part and you want to re-use some of the design areas such as My Account pages…
This is the time to hold your horses and plan your design file structure cos, here’s what thoughts might be flying through your head:
- “Should I just edit the files in /default/modern?”
- “I could copy the /default/modern directory to /default/mytheme, then edit the files.”
- “What if I create my own package/theme?”
- “( . )( . )”
Let’s have a look at Magento’s theme file structure:

Default frontend design template

Default skin folders
Let’s look closer at the default Magento design folder structure. Since Magento 1.4 the front end design has a base folder which implements all the layouts and phtml templates of a default Magento site. The next sibling folder is default. This contains the customized designs that implement the various themes that are shipped with Magento such as the default, blank and modern themes and the iphone theme.
If you look at the theme folder contents closer, you’ll notice that some have very few layout and template files, why?
That’s because everything is “inherited” from the base theme and our default sub-folders contain only theme overrides. Layout files and template files placed here will override the ones in the same location under the base folder. Also, every time you update Magento, chances are that some of the default shipped theme files have changed also.
With that in mind and the fact that most times you will want to use one of these themes as the starting point for your own theme, how can you leverage off the theme override mechanism and keep your site upgradable with as little hassle as possible?

Custom frontend design template

Custom skin folders
Here I chose to create my own design package called mypackage and copy the theme I want to base my design on into the default sub-folder. Then I created a master folder. This is where I’ll be putting my own theme overrides under master/layout and master/template. The same applies for files in the skin folders in which case the overrides are the css, js and image files. Bare in mind that if you copy the skin.css from your default folder, you will need to copy all the images as well since the CSS will have relative image paths. A better approach is to add your own mytheme.css file and keep the original in its place.
Why copy the starting design into default you ask?
Well, we need it so that this can be our starting design, otherwise our theme falls back straight to the base design. Also, come update day, and the theme you started from had updates, you can simply re-copy the whole theme into your default theme folder and have potentially most of the theme updates applied to your theme also. Of course, if you have a lot of overrides, then you’d have to compare those files with the original ones and merge in any updates if they are important.
You can see that this approach gives you a lot of flexibility and keeps your site more upgradable. Of course, you still have to run a comprehensive file comparison between upgraded and your custom theme files but it’s a great deal easier when there’s only the files you overrode.
Originally published on magebase.com. Copyright © 2010 Magebase - All Rights Reserved.




Proud members of the
Great intro Robert.
You could side step the copy part and set up a symbolic link to the theme you are starting with. So on a linux server this would look like
cd /app/design/frontend/mypackage
ln -s ../default/blank default
and repeat for the skin
cd /skin/frontend/mypackage
ln -s ../default/blank default
The upside to this is that you will get upgrades to the blank theme automatically. The downside is that linked directories need special attention when moving to a new server or backing up.
[...] know that we can just copy the selected starting design into a new design package and start modifying all the layout XML and phtml files but what if the original theme is updated [...]
Hello Robert,
It is nice article. I am facing problem with Magento new theme installation. I already have installed newtheme at magento by copying files at app and particular folder via FTP. After copy files , I have set new theme for pages at CMS tab CMS -> Pages – Design menu. It is showing new theme for all pages mentioned at CMS-> Pages section. However some dynamic pages re not there like My Cart, My Account, Check Out, Login etc..
How to set new theme for that pages?
Thanks
Thank you! I was thinking this would be the way to go but there are so many conflicting opinions out there. This one makes the most sense to me and works.
[...] We have already written about how to create your own design package but in our case we will simply make a copy in the default package undermyiphone. [...]
Very informative post related to magento . how to implement theme in new design package and how to use magento.