我目前正在开发一个带有Magento的电子商务系统。我已经打电话给我的页脚 <?php echo $this->getChildHtml('footer') ?>
和我layout.xml有以下标签来定义“页脚”将脚本标记添加到magento layout.xml
<reference name="footer">
<block type="page/footer" name="footer">
<action method="setTemplate">
<template>page/html/footer_home.phtml</template>
</action>
<action method="setTemplate">
<template>muaw/footer_script.phtml</template>
</action>
</block>
</reference>
footer_home.phtml
是实际的页脚和footer_script.phtml
是<script>
标签对于一些jQuery的文件。我的问题是,为footer_script.phtml
添加第二组<action>
标记替换实际页脚。有没有其他方法来获取这两个文件?
由于页脚将始终显示在网站,和u在 并将该js放入js文件夹中。 – 2015-03-25 12:15:21
不错的主意。但我不认为这是最佳做法。无论如何。 – 2015-03-25 12:43:18
您在'page/footer'块上调用了两次'setTemplate()'方法。这没有任何意义,因为该块只能有一个模板,而不能有两个。使用不同的参数调用该方法两次,因此会导致其中一个无用。因此,无论您尝试做什么都很明显,您已经使用了错误的工具。 – hakre 2015-03-25 13:32:18