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.

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

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题