Today we’re discussing one of the relevant questions every Magento developer should be aware of. You’re suggested to learn the current theme structure in Magento as well as theme files search. Hope you’ll find it worthwhile.
What is the purpose of packages
Packages help us arrange a theme in such a convenient manner as it thinks fit. Besides, it allows making themes distinguished to be used for different stores. When performing it, some files are changed and the files which are not found will be inherited from a parent theme. Actually, it saves us the trouble of duplicating templates/static files.
As for Magento up to 1.9, the theme inheritance looks like this:
<package>/<mytheme> -> <package>/default -> base/default
With the release of Magento 1.9, a new feature was implemented. Now it’s possible to configure a parent theme manually with the file
etc/theme.xml, where you can specify a parent theme. For example,
<!-- file: <mypackage>/<mytheme>/etc/theme.xml -->
What is the purpose of the theme fallback
The theme fallback is aimed at maintaining your Magento store while you’re upgrading it in order to avoid any breakdowns. If there was no theme fallback, we would have to change Magento files with possible negative consequences.
What is the purpose of separating the skin and the design files
The reason why the folder “skin” is placed in another directory is closely connected with a security issue, as static files should be accessed directly, while folder content is hidden. Moreover, it can help to reduce the nesting level.