禁用某些主题中的模块
运行某个主题时是否可以禁用某些模块?我正在开发 Magento 商店的移动友好版本,并且在一些扩展中遇到了一些问题。无需自定义它们,默认的 iphone 主题就足够了,因此我想禁用这些模块,以便它在移动设备上运行默认代码。这可能吗?如果没有,也许我从错误的角度来处理这个问题。处理此类事情的正确方法是什么?
Is it possible to disable certain modules when running a certain theme? I'm working on a mobile friendly version of our Magento store and I've run into some issues with a few extensions. Rather than customize them, the default iphone theme is sufficient, so I'd like to just disable those modules so it runs the default code when on a mobile device. Is this possible? If not, perhaps I'm approaching this from the wrong angle. What is the right way to handle this type of thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来您需要查看系统配置的例外部分,您应该至少能够为移动用户代理设置一些条件。
我不久前写的一篇关于在 Android 上使用 iphone 主题的文章可能会帮助您了解一些:
http://www.molotovbliss.com/iphone-magento-theme-company-with-android
至于基于异常禁用模块听起来您需要管理模块etc/ xml 文件在需要时将
true
设置为false
,但是我相信您可以禁用输出也通过内置方法来控制模块。希望这有帮助。
It sounds like you need to look into the Exceptions portion of the System configuration, you should be able to at least setup some conditions for mobile user agents.
An Article I wrote a while back on using the iphone theme for android may help shed some light for you:
http://www.molotovbliss.com/iphone-magento-theme-compatible-with-android
As far as disabling modules based of the exceptions sounds like you'll need to manage the modules etc/ xml files to set
<active>true</active>
to<active>false</active>
when needed, however I believe you could disable the output of the module via a built in method also.Hope this helps.
Brian,我认为您可以使用依赖于模板的 local.xml 文件来完成此操作。
以下是我的文件中的一些示例:
当您使用删除标记时,它会从以下位置删除具有指定名称的所有块:
整个布局,无论上下文如何。所以,如果我删除 right.newsletter
上下文和该名称用于上下文中,
那么两个块都将被删除。因为remove操作是在全局上下文中进行的,
您只能删除一个元素一次。
Brian, I think you can do it using local.xml file that is template dependent.
Here are some examples from my file:
When you use the remove tag, it removes any blocks with the specified name from
the entire layout, regardless of the context. So, if I remove right.newsletter in
the context and that name is used in say the context,
then both blocks will be removed. Because remove operates on the global context,
you can only remove an element once.