Magento Theme Hierarchy - magento

Currently I am moving the theme file from Default/XXX to XXX/default . From
http://www.magentocommerce.com/knowledge-base/entry/magentos-theme-hierarchy
I found out that Magento searches the file in following sequence:
Package/theme->Package/default->Base->default.
Is it possible to make it search the theme like this: Package/theme1->Package/theme2->Package/default->Base->default?
Besides that, will the magento still be loading the default/default theme?
Thx

Magento system will fall back the files using below order.
Using DEFAULT package with DEFAULT theme
1) app/design/frontend/{DEFAULT}/{DEFAULT}
2) app/design/frontend/base/{DEFAULT}
Using DEFAULT package with Custom theme
1) app/design/frontend/{DEFAULT}/{MY-THEME}
2) app/design/frontend/{DEFAULT}/{DEFAULT}
3) app/design/frontend/base/{DEFAULT}
If you are using the Custom Package with Custom theme.
1) app/design/frontend/{CUSTOM-PACKAGE}/{MY-THEME}
2) app/design/frontend/{CUSTOM-PACKAGE}/{DEFAULT}
3) app/design/frontend/base/{DEFAULT}
These above order only magento files are fallback.

Old question but as I stumbled across this I would like to add the newest fallback hierarchy.
Since 1.9 you can define the fallbacks in a theme.xml in your theme folder. See http://alanstorm.com/magento_parent_child_themes for further information.

Related

How can I install new theme in Magneto ?

I want to install new theme in magento and I have also followed step of this link (https://www.siteground.com/tutorials/magento/magento_themes.htm) but I am not abling to get theme in magento. Please suggest me how can I install theme in magento ?
Thanks
If you already have the pre-built theme, then in magento project folder navigate to
app/design/frontend/default
Place your theme folder here.
Now to activate your theme. Log in to your admin panel.
Navigate to
system->configuration
Click in the design tab in the left hand side
Under the "Pakage Name" put you package name i.e "default" in this case and under you theme In the "Template" put your theme name "Your_theme_name" i.e your theme folder name that you copied inside default directory.
If you are creating a new theme, just create a new folder inside default directory and follow the step as described above.
In this way you can install a new theme.
Hope this will help.
It depends how theme you want to use is distributed. If it is a package, just extract it to your root folder and you should get proper folders in skin and app/design dirs and what you need to do then is to set correct package and / or theme in backend (Configuration > Web > Design). For full package theme name would probably always be default. Although if you are only adding new theme, you should pick its name app/design/frontend/default/{theme_name} and same in skin folder (if it includes some additional css, images and / or javascript).

Magento's theme hierarchy: base/ vs default/

In this material I read about themes in magento.
I also talks about default/default folder, but it doesn't specify clearly which is on top of which.
So, if a have mythemepackage/default, default/default and base/default, is default/default reached while getting falledback from mythemepackage to base?
[EDITED]
NO,
If you have below package/theme
1. mythemepackage/mytheme
2. mythemepackage/default
3. default/default
4. base/default
and you have set the package to mythemepackage and default theme to mytheme.
Then Magento first check in mythemepackage/mytheme folder and if not found then check in mythemepackage/default and if still not found then look in base/default.
If not found, a rendering error will occur.

Magento: theme fallback hierarchy question

Can someone verify what I think is what's happening with Magento's fallback theme hierarchy.
The final fall-back point is the /base/default/ theme.
Within your interface/package (they are the same things right?), your default theme is selected at, from the Magento admin page, System->Configuration->General->Design->Themes->"B" ("B" is an example name of the theme).
On top of your default package theme, you can select an active theme from System->Design->"A".
So with this setup, Magento will look into "A" first, then in "B", then finally resort to base/default if neither A or B has files it needs.
Correct or no? TIA!
Sorta.
The fall-back hierarchy in Magento CE v1.4+ and EE v1.8+ is as follows.
Look for requested file in:
app/design/frontend/custom_package/custom_theme/
skin/frontend/custom_ package/custom_theme
If not found, look for requested file in:
app/design/frontend/custom_package/default
skin/frontend/custom_package/default
If not found, look for requested file in:
app/design/frontend/base/default
skin/frontend/base/default
If not found, a rendering error will occur.
Source: Magento's Theme Hierarchy - Changes in CEv1.4 and EEv1.8
I will do my best to clarify some points for you.
If you are not using a child theme, magneto will use /base/, however if you have a child theme active, magneto will use your custom theme files.
For example, If your new theme file has a header.phtml file but not footer.phtml, Magento will automatically fall back to the base. this is why its never smart to edit core files

Magento Extensions: How do I tell my build system where the active theme is located?

My extremely simple build system for Magento needs to deploy some extension frontend code into the appropriate theme folder. But I don't know how to get it to find out which folder to put the files in at build time. Anyone know how to get this data out of Magento?
Put your code in the base/default theme (default/default prior to version 1.4, or both just to be sure) and it will be available to all themes thanks to inheritance.
Each store within Magento can set it's own theme so you might have more than one to consider. Also certain pages like CMS, category or product pages can choose their own theme to override the store and global settings.
To find the package and theme that corresponds to the folder app/design/frontend/PACKAGE/THEME use;
Mage::getStoreConfig('design/package/name', $storeId)
and;
Mage::getStoreConfig('design/theme/default', $storeId)
If calling from a PHP file external to Magento then you'll need to include 'app/Mage.php'; first. The $storeId value can be either an int as used internally or the store code saved in System > Configuration > Manage Stores - there is usually at least a "default" value.

Changing a Magento default theme

My understanding of Magento is that you can only have 2 themes loaded at any one time. ( according to the Magento design guide)
Also, that there is two types of themes - default and non-default (i.e. default contain all possible options, non-default override a subset).
All the documentation I've read says that both default and non-default themes are set in the configuration-> section. I don't see how I can have a customised default theme (not called default) and non-default theme at the same time. Do I have to rename my theme to default in order to use non-default themes?
I had the wrong idea.... 3 themes are loaded.
According to the hierarchy, from lowest priority to highest-
default - this theme must be called default. I will be planning on using the magento default theme untouched as this theme. This cannot be currently overwriten.
your custom default theme - specified in configuration->design->theme->default
I will be using the Magento blank theme as base for developing an everyday store theme.
your custom non-default theme - specified in configuration->design->theme->(layout, templates and skin)
I will be using this to create special occasion themes, e.g. Christmas or sale, that will override only a subset of the default theme.
You can start with your own magento custom theme development and also put your name instead of using default or else, and also copy all the templates files and layout XML files and save it in your theme folder. same way repeat the things with the Skin folder also.
Default folder structure
Template and XML files >magento>> app >> design >> front-end ?? base or default >> theme-name
SKIN - CSS and JS files >magento >> skin >> front-end >> base or default >> theme name
now just copy and paste the theme files from above structure and paste it to the same place and just change the name to base or default to you favorite name.
NOw go to admin >> system >> design >> and Add custom magento theme >> here you will see the theme which you have created in folder structure, just select and save the theme and then just delete or refresh the cache and refresh your web page thata all.
Thanks
Magento Development

Resources