php - 将自定义链接添加到顶部链接 Magento

标签 php xml magento header frontend

我可以添加自定义链接,例如 http://google.com/这段代码:

<reference name="top.links">
    <action method="addLink" translate="label title" >
        <label>Your Label</label>
        <url ....../>
        <title>Your Title</title>
        <prepare/>
        <urlParams/>
        <position>100</position>
    </action>
</reference>

此代码来 self 在 Magento 中的主题的 customer.xml

提前致谢

最佳答案

是的,你可以。将此代码添加到主题的 local.xml 中的 <reference name="top.links">

<action method="addLink" translate="label title">
    <label>Google</label>
    <url>http://google.co.in</url>
    <title>Google</title>
    <prepare/>
    <urlParams/>
    <position>80</position>
    <aParams>
        <target>_blank</target>
    </aParams>
</action>

附:<target>添加到在新选项卡中打开链接。

关于php - 将自定义链接添加到顶部链接 Magento,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37560326/

相关文章:

PHP:如何在类中创建动态变量

php - 在 FPDF 中设置纸张大小

php - 此路由不支持 POST 方法。支持的方法 : GET, HEAD。拉维尔

java - 你能帮我完成我的 Android 添加程序吗?

android - 允许 TextView 在屏幕之外

.net - Powershell 3.0中的SOAP语法

php - 用 PHP 打印成 Javascript

php - 字段 "to"必须是 JSON 字符串 [Firebase]

java - 如何修复此 "All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes)"

javascript - Magento 中使用 Javascript 和 PHP 的中国密码政策