【问题标题】:How to Add Links to Magento Default Footer如何将链接添加到 Magento 默认页脚
【发布时间】:2015-11-27 02:11:34
【问题描述】:

我已经查看了几个关于在 Magento 中创建自己的自定义页脚的教程,但没有一个与添加到默认页脚的链接有关。我想在 Magento 默认页脚的“帐户”div 下添加一些链接。这是我在 app/design/frontend/rwd/default/layout/customer.xml 中的内容:

<default>
    <!-- Mage_Customer -->
    <reference name="top.links">
        <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
        <action method="addLink" translate="label title before_text" module="customer"><label>Register</label><url helper="customer/getRegisterUrl" /><title>Register</title><prepare/><urlParams/><position>100</position><li/><a/></action>
    </reference>
    <reference name="footer_links2">
        <action method="addLink" translate="label title" module="catalog"><label>My Account</label><url helper="customer/getAccountUrl" /><title>My Account</title></action>
        <action method="addLink" translate="label title"><label>Customer Service</label><url helper="/customer-service/" /><title>Customer Service</title><prepare>true</prepare></action>
    </reference>
</default>

【问题讨论】:

    标签: magento footer magento-1.9


    【解决方案1】:

    您可以使用下面的代码在页脚中添加链接。您的代码几乎是正确的,但是您在参考名称中犯了错误,请确保参考名称footer_links

    <reference name="footer_links">
                <action method="addLink" translate="label title" module="catalog"><label>My Account</label><url helper="customer/getAccountUrl" /><title>My Account</title></action>
                <action method="addLink" translate="label title"><label>Customer Service</label><url helper="/customer-service/" /><title>Customer Service</title><prepare>true</prepare></action>
    </reference>
    

    【讨论】:

    • 我试过你的建议,但没有奏效。参考名称footer_links2 是默认参考名称。什么都没有改变。但是,我使用您建议的代码尝试了footer_linksfooter_links2,但都没有成功。还有其他建议吗?
    • 你能检查来自xml或静态块的默认链接吗?
    • 它来自一个 .xml。我尝试先更改静态块,但没有任何反应,并且没有显示“我的帐户”或“订单和退货”链接。
    猜你喜欢
    • 1970-01-01
    • 2012-07-20
    • 1970-01-01
    • 2021-04-15
    • 1970-01-01
    • 2015-05-21
    • 2011-10-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多