magento给My Account等链接增加nofollow标签

Magento里面头部的My Account,Log In,My Wishlist几个链接都是通过xml布局文件进行调用的,为了SEO分配权重必须为它们加上”nofollow”标签,但它的链接并不是普通的HTML代码,所以想加nofollow标签就有点难度了。

找到模板下的customer.xml文件,默认位置是app/design/frontend/base/default/layout/customer.xml
打开编辑,例如要给”My Account”链接加“nofollow”属性, 搜索”My Account” ,完整代码如下:

<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>
<null/>
<aparams>rel="nofollow"</aparams>
</action>

别的照猫画虎就行了

原文地址:https://www.cnblogs.com/liuxgnu/p/3535395.html