My extremely simpl开发者_Go百科e 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.
精彩评论