【问题标题】:How to use local.xml to insert a block in Magento 1.8?如何使用 local.xml 在 Magento 1.8 中插入块?
【发布时间】:2014-04-21 18:58:37
【问题描述】:

如何使用 loca.xml 插入块?

我想将 cms 中的静态块(标识符:footer_links)插入到这个 footerinsidemy page.xml,但是 before footer_links,

<block type="core/template" name="bottom.footer" as="bottom.footer" template="page/html/footer-bottom.phtml">
   <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
   <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>

这是我的 local.xml 中的配置,

<block type="cms/block" name="cms_footer_links" before="footer_links">
 <!--
                The content of this block is taken from the database by its block_id.
                You can manage it in admin CMS -> Static Blocks
            -->
<action method="setBlockId"><block_id>footer_links</block_id></action>
</block>

有可能吗?

【问题讨论】:

    标签: xml magento


    【解决方案1】:

    回答,

    <reference name="footer">
            <block type="cms/block" name="cms_footer_links" before="footer_links">
                <action method="setBlockId">
                    <block_id>footer_links</block_id>
                </action>
            </block>
        </reference>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-29
      • 1970-01-01
      • 2011-05-24
      • 1970-01-01
      • 2012-05-13
      相关资源
      最近更新 更多