【问题标题】:Magento separate footer linksMagento 单独的页脚链接
【发布时间】:2013-07-24 22:46:51
【问题描述】:

好的,所以我很难理解所有这些块的东西。一篇文章再读多少遍都抓不住。

我在 footer_links 静态块中有关于我们、客户服务和隐私政策。我想要在一个部分。 然后我想要站点地图、搜索词、高级搜索、订单和退货,并在其他地方联系我们。我看到 Magento 将这两个页脚链接部分合并到一个块中。我希望它们在两个单独的块中。

我该怎么做?

我想我知道如何为我想要的第三组链接添加另一个块,但是我在尝试将这两个链接分开时遇到了麻烦。

【问题讨论】:

    标签: magento


    【解决方案1】:

    啊,如果有人想将它们分开,您可以这样写:

    <?php echo $this->getChildHtml('footer_links') ?>
    
    <?php echo $this->getChildHtml('cms_footer_links') ?>
    

    第一个是由footer_links块定义的默认链接,然后cms_footer_links是您的cms静态块,称为footer_links..因此您可以定义更多块并使用cms_whatever_you_call_it =)

    并将其添加到您的 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>
    

    当然是 name="cms_whatever_you_call_it" :P

    【讨论】:

    • 在 magento 中包含这样的链接集(或任何内容)的方法数量接近无穷大。直接调用静态块可能比通过 getChildHtml 更好(这可能正是它在做什么)。
    猜你喜欢
    • 1970-01-01
    • 2015-09-23
    • 2010-11-18
    • 2014-09-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-17
    • 2015-11-27
    相关资源
    最近更新 更多