【发布时间】:2011-03-30 19:53:14
【问题描述】:
我可以使用保存在 ../myCustomTheme/layout/local.xml 中的以下代码向 Magento 的 top.links 添加自定义链接
<reference name="root">
<reference name="top.links">
<action method="addLink" translate="label title">
<label>example</label>
<url>example</url>
<title>example</title>
<prepare>true</prepare>
<urlParams helper="core/url/getHomeUrl"/>
<position>100</position>
<liParams/>
<aParams>class="top-link-example"</aParams>
<beforeText></beforeText>
<afterText></afterText>
</action>
</reference>
</reference>
以上代码将创建一个名为 example 的链接,指向 http://myexampledomain.com/example。如果我改变这行代码
<url>example</url>
到
<url>http://myotherexampledomain.com</url>
我最终得到了一个名为 example 的链接,该链接指向 http://myexampledomain.com/http:/myotherexampledomain.com。我尝试将 prepare 参数设置为 false 并通过查看 ../app/code/core/Mage/Core/Model/Url.php 将各种参数添加到 urlParams 无济于事。
【问题讨论】:
标签: magento-1.4 magento