duanpai9945 2015-03-25 10:55
浏览 45

将脚本标记添加到magento layout.xml

I'm currently developing a eCommerce system with Magento. I have my footer called as <?php echo $this->getChildHtml('footer') ?> and my layout.xml has following tags to define the 'footer'

<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 is the actual footer and footer_script.phtml is a file with <script> tag for some jquery. My problem is that adding the second set of <action> tags for footer_script.phtml replace the actual footer. Is there any other way to get both files?

  • 写回答

2条回答 默认 最新

  • dongliechuich10319 2015-03-25 14:15
    关注

    You don't need to set two templates for the footer. Just refrence your phtml file like so...

    <reference name="footer">
        <block type="page/footer" name="footer">
            <action method="setTemplate">
                <template>page/html/footer_home.phtml</template>
            </action>
        </block>
        <block type="core/template" name="footer_script" template="muaw/footer_script.phtml"/>
    </reference>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?