Topmagento.com|Magento技术交流站

给My Account,Log In,My Wishlist链接增加nofollow属性

栏目:magento疑难解答      1,923 views      2 枚回复

大家都知道magento里面头部的My Account,Log In,My Wishlist几个链接都是通过xml布局文件进行调用的,为了SEO分配权重必须为它们加上”nofollow”属性,但它的链接标签并不是普通的标签,所以想加nofollow属性就有点难度了。下面是我的方法:
首先找到对应模板下的customer.xml 文件,默认位置是app/design/frontend/base/default/layout/customer.xml
打开编辑,例如要给”My Account”链接加”nofollow”属性, 搜索”My Account” ,然后把”rel=”nofollow”” 放在结束标签后面就解决了。完整代码如下:

1
2
3
<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>100</position><null /><aparams>rel="nofollow"</aparams></action>
</reference>


标签:

转载注明:转自Topmagento.com|Magento技术交流站

本站遵循:署名-非商业性使用-禁止演绎 3.0 共享协议

收藏分享: QQ书签 / 百度收藏 / Google书签 / 收藏到鲜果 / Digg / Del.icio.us


2 枚回复


  1. Elaine 说道:

    我试了一下还是不行啊。。

    [回复]

    kivin 回复:

    清除缓存试试,一定可以的

    [回复]


发表回复


XHTML: 您可以使用如下代码:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>