Developer forum

Forum » Development » no follow

Reply
How can I add a rel="nofollow" to a link in Dynamicweb? I can add it in my template, but that's not what my client wants. He wants to be able to add the nofollow to some of the pages in the main menu, not all. Is this possible with Dynamicweb?

Replies

 
Nicolai Høeg Pedersen
Reply
The only option in the navigation is to use the XML/XSLT navigation and add some kind of logic that adds nofollow on the hrefs...
 
Reply
Or you can extend the navigation structure as explained here: http://devierkoeden.com/Articles/[articleId/12]/Extending-the-Google-Sitemap-Feature-with-Custom-Content.aspx

Unfortunately, you can't completely replace the menu item with your custom object inheriting NavigationItem, but you could set, say, the Title attribute to "nofollow" for the appropriate nodes, and then use XSLT like this:

<a>
  <xsl:if test="@Title='nofollow'">
    <xsl:attribute name="rel">nofollow</xsl:attribute>
  </xsl:if>
  <xsl:attribute name="href"><xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/></xsl:attribute>
  <xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
</a>

Hope this helps,

Imar

 

You must be logged in to post in the forum