Magento 扩展:如何告诉我的构建系统活动主题所在的位置?
我的 Magento 极其简单的构建系统需要将一些扩展前端代码部署到适当的主题文件夹中。但我不知道如何让它找出在构建时将文件放入哪个文件夹。有人知道如何从 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将您的代码放入
base/default
主题(default/default
版本 1.4 之前的版本,或两者都只是为了确定),并且由于继承,它将可用于所有主题。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.Magento 中的每个商店都可以设置自己的主题,因此您可能需要考虑多个主题。此外,某些页面(例如 CMS、类别或产品页面)可以选择自己的主题来覆盖商店和全局设置。
要查找与文件夹
app/design/frontend/PACKAGE/THEME
对应的包和主题,请使用;和;
如果从 Magento 外部的 PHP 文件调用,那么您首先需要
include 'app/Mage.php';
。$storeId
值可以是内部使用的 int 或保存在 System > 中的商店代码。配置>管理商店 - 通常至少有一个“默认”值。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;and;
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.