我创建了我的模块,它工作正常。现在我想包括一些自定义布局更新,以便我可以为它加载所需的JS和CSS文件。Magento - 为模块添加自定义布局更新
因此,我进入了app/code/community/module/relatedbrand/etc/config.xml,并在结束标记</global>
下面添加了以下代码。
<frontend>
<layout>
<updates>
<relatedbrand>
<file>relatedbrand.xml</file>
</relatedbrand>
</updates>
</layout>
</frontend>
然后应用程序/设计/前端/模块/默认/布局/ relatedbrand.xml内我具备以下条件:
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<reference name="head">
<action method="addJs"><script>jquery/jquery.js</script></action>
<action method="addJs"><script>carousel/carousel.min.js</script></action>
</reference>
</layout>
然而,当我浏览到该页面,该模块是活动的旋转木马不包括.min.js。我错过了什么?
啊该死!非常感谢Marius,我知道它会很小。你又来了,让我觉得有点傻;) – Karl