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

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.

Related

Magento loading base theme instead of downloaded theme

Im trying to install a theme on magento 1.9. Have copied all files into the correct places.
Under System -> Configuration -> Design -> Themes I have set templates, skin, layout and default all to the theme name.
The problem I think i am having is 'Current package name' It was originally set to 'rwd' and when it is set to this it loads the default 1.9 magento theme. However when i change this to 'default' it loads the magento base theme. If i set the package name to the name of the theme it also loads the base package.
Skin Directory Structure
Design Directory Structure
Did you check your custom design? Access: System > Design
just cross check following configuration with your configuration.
Then clear cache and check.

Custom Sub Magento Theme Not Working

Hi my theme just updated to a new file organization that uses sub custom themes so that I can update the theme without overwriting the files I changed myself.
I downloaded the new theme and set up the new file path, but the site still reads from
skin/frontend/default/shopper/css/styles.css
when it should read from
skin/frontend/shopper/default/css/styles.css
I set the current package name to “shopper” and set default (under Design/Themes) to custom. I know I want my custom files of the theme to go under shopper/custom, and then magento should check for files at shopper/default and finally check for files at base. For some reason its ignoring the shopper directory and still referencing from the old default directory.
And saved everything. I also disabled and flushed all the caches.
The two images attached show how I have it set up in magento via the admin and the ftp. I haven't been able to solve this for months.
FIXED IT!
The issue was not in System > Configuration > Design but in fact System > Design I discovered that System > Design had it set up for Default/Shopper and there wasn't a time frame for it. The following link helped me reach my conclusion.
http://www.magentocommerce.com/boards/viewthread/197908/
You are supposed to System > Design for temporary theme changes, but my site had it set with no time frame thus always overwriting my settings in System > Configuration > Design

How to make third party magento extension compatible with store theme.

What is best way to make third party extension compatible with store theme which is not default theme. I don't want to do following:
1) We can't modify extension css/phtml file becuase this will make up-gradation of extension because in that case our extension will go away.
Thanks!
I suggest finding CSS from a standard Magento install and use that. Having the least styling possible will mean the most flexibility for the users. Also include instructions on where the file is by default and to install in their theme's template location. I believe this could be programmatically determined and be checked in the Admin area of your extension.

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

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