duanfu5239 2013-08-21 08:12
浏览 41
已采纳

如何在Magento 1.7.2中将Magento CMS PAGES添加到topMenu(不在top.links中)

I want to add Magento CMS PAGES to topMenu (not in top.links) in my custom template in Magento 1.7.2

So I created a file called local.xml in the path

app/design/frontend/mytheme/default/layout/local.xml

The content in the xml:

<?xml version="1.0"?>
<layout version="0.1.0">
    <default translate="label" module="page">   
      <reference name="topMenu">
            <action method="addLink" translate="label title"><label> TEST </label><url helper="customer/getAccountUrl"/><title> TEST </title><prepare/><urlParams/><position>1</position></action>
        </reference>
    </default>
</layout>

This XML supposed to create a link called TEST in the topMenu that connects with "customer/getAccountUrl"

but it doesnt appear my link...Anybody suspects what it might be wrong?

  • 写回答

1条回答 默认 最新

  • du8791069 2013-08-22 14:49
    关注

    You can add new links to CMS pages like this:

    app/design/frontend/default/theme/layout/customer.xml (About line 49)

    <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>60</position></action>
            <action method="addLink" translate="label title" module="customer"><label>Corporate Orders</label><url>http://www.yourdomain.com/corporate-orders.html</url><title>Corporate Orders</title><prepare/><urlParams/><position>50</position></action>
            <action method="addLink" translate="label title" module="customer"><label>Delivery</label><url>http://www.yourdomain.com/delivery.html</url><title>Delivery</title><prepare/><urlParams/><position>40</position></action>
            <action method="addLink" translate="label title" module="customer"><label>Contact Us</label><url>http://www.yourdomain.com/contact-us.html</url><title>Contact Us</title><prepare/><urlParams/><position>20</position></action>
            <action method="addLink" translate="label title" module="customer"><label>Customer Service</label><url>http://www.yourdomain.com/customer-service.html</url><title>Customer Service</title><prepare/><urlParams/><position>30</position></action>   
        </reference>
    

    This is an example of what I have on my site on Magento 1.6.1, but I cannot see how this could be different on 1.7.2.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 平滑拟合曲线该如何生成
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了
  • ¥15 链式存储应该如何解决
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站