更改 Magento 中所有模块页面的设计
我正在 Magento 中创建一个自定义模块,一切进展顺利...除了我想更改模块中所有页面使用的基本布局模板。我做了一些谷歌搜索但收效甚微。有人有答案吗?我想做一些类似的事情:
...
<optionbox>
<reference name="root">
<action method="setTemplate"><template>page/empty.phtml</template></action>
</reference>
</optionbox>
正如你可能猜到的,这是一个灯箱......我猜我是一个贪吃惩罚的人:)
I'm doing a custom module in Magento and everything is going swimmingly... except I want to change the base layout template that all pages in the module use. I've done some googling with little success. Anyone have any answers? I want to do something along the lines of:
...
<optionbox>
<reference name="root">
<action method="setTemplate"><template>page/empty.phtml</template></action>
</reference>
</optionbox>
As you may guess, it's a lightbox... I'm a glutton for punishment I guess :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我注意到您的布局更新的根为
,理论上应该涵盖该模块下的所有控制器和操作。但是,我只见过使用
完成此操作,其中index
来自模块中的IndexController
。因此,也许可以尝试将其替换为您的控制器名称:另外,您应该尝试 Alan Storm 的 LayoutViewer 模块< /a>,使用说明此处。这可能会帮助您调试它。
干杯,
京东
I notice that you've got the root of your layout update as
<optionbox>
which in theory should cover all controllers and actions under that module. However, I've only ever seen this done with<optionbox_index>
whereindex
is fromIndexController
in your module. So perhaps try this replaced with your controller name:Also, you should try Alan Storm's LayoutViewer module, instructions on it's use here. That might help you debug it.
Cheers,
JD
在我的模块中,我在控制器操作中执行此操作,如下所示:
In my modules I do it within the controller action like so:
您是否尝试过将该片段插入到您的
optionbox.xml
布局文件中?看起来它应该像你拥有的那样工作?have you tried inserting that snippet into your
optionbox.xml
layout file? It looks like it should work as you have it?