rel=nofollow on links

Vote:
 

Hi all,

I am new to the episerver world and this forum, so I hope that I am going about this the correct way in asking for help/ advice here.

For SEO purposes, I have been asked to add rel=nofollow to certain links in the footer our website. Currently, the footer displays links via the 'page' property (root footer folder is selected) which lists all pages beneth this.

My question, is there any way to implement rel=nofollow on the links that are generated (so in the source it would read <a href="http://www.example.com/" rel="nofollow">Link text</a> or will I need to create a new property?

Thank you in advance for any help that you can offer.

James

 

#60074
Jul 16, 2012 15:05
Vote:
 

Hi James

Since you're getting the children of a root/container page I would just add a property to those pages that define if you want to hide that page from search engines or not (eg. selected/not selected property). Based on that you can then check if you should add the rel="nofollow" attribute or not.

Hope this helps

Frederik

#60078
Jul 16, 2012 16:39
Vote:
 

Hi Frederik,

Thank you for your reply, this makes sense. However, the requirement is to add the rel=nofollow to the link and not the page.

Is it possible to use a checkbox to add the rel=nofollow to any links that are made to the page?

Thanks,

James

#60084
Jul 17, 2012 9:00
Vote:
 

When you're saying page do you mean EPiServer page or any URL?

Frederik

#60087
Jul 17, 2012 10:10
Vote:
 

All pages would be on episerver.

There is currently a root container called footer which contains the footer pages. The homepage has a property to specify footer links, where you select the footer root container. When this is selected, it automatically shows all pages under the footer root folder.

As these links are automatically generated there is no way from the front end to add the rel="nofollow" tag to the links. Is there some code that can be implemented in the backend to add the rel tag to these auto generated links?

James

#60088
Jul 17, 2012 10:33
Vote:
 

Like I said, add a new property to those page types with a selected/not selected property. Then inside your Repeater, PageList or whichever web control you're using to render the list, in the ItemTemplate check if that property is true, if it's add the rel="nofollow" attribute to that link.

Frederik

 

#60089
Jul 17, 2012 10:40
Vote:
 

Hi Frederik,

In theory that solution sounds perfect. I just need to figure out how to code it (as I said i'm new to this).

The masterpage uses a PageList - here is the code: 

<EPiServer:PageList ID="OtherLinks" runat="server" EnableVisibleInMenu="true" SortOrder="Index">
                            <HeaderTemplate><ul></HeaderTemplate>
                            <ItemTemplate>
                                <li><EPiServer:Property ID="Property1" PropertyName="PageLink" runat="server" /></li>
                            </ItemTemplate>
                            <FooterTemplate></ul></FooterTemplate>
                        </EPiServer:PageList>

Thankyou very much for your help - it is really appreciated. Hopefully I can figure this out!

James

    

    

#60090
Jul 17, 2012 14:30
Vote:
 

Something like this:

<ItemTemplate>
 <%# Container.CurrentPage.HtmlLink() %>
</ItemTemplate>

HtmlLink() is an extension method that looks like this:

public static string HtmlLink(this PageData pageData)
{
	string noFollow = string.Empty;
	
	if (pageData["NoFollow"] != null && (bool)pageData["NoFollow"])
	{
		noFollow = "rel=\"nofollow\"";
	}
	
	return string.Format("<a href=\"{0}\" {1}>{2}</a>, pageData.LinkURL, noFollow, pageData.PageName);
}

This is just to give you an idea.

Good luck

Frederik     

 

#60091
Jul 17, 2012 14:45
Vote:
 
#60092
Jul 17, 2012 14:53
Vote:
 

Hi James,

You should no longer use rel=nofollow as it does not have the affect on Page Rank as it used to. See seomoz.org or another up to date SEO blog for more information.

-Alex

#60100
Jul 17, 2012 16:47
Vote:
 

@Alexander, are you sure? http://support.google.com/webmasters/bin/answer.py?hl=en&answer=96569

#60101
Jul 17, 2012 17:05
Vote:
 

Yes I am sure.  You don't pass link juice to the nofollowed links, but you still lose the juice for the page. E.g. if you have 50 regular links and 50 nofollow links, then your page will still only get half the juice that having just 50 regular links and 0 nofollow links would give you. This used to work, but Google changed it a few years back.

http://www.seomoz.org/q/too-many-on-page-links-rel-nofollow

#60105
Jul 17, 2012 18:26
Vote:
 

Hi guys,

Just a quick followup on this topic. I have managed to get the nofollow to work, however the rel="nofollow" appears after the href="" as some links are using the asp:hypserlink property which refrences the URL from an ID (captures when the page loads) so I assume that it puts this as the last property, here is the code:

<asp:HyperLink ID="1" runat="server" CssClass="1" ToolTip="1" Target="_blank" rel="nofollow">1</asp:HyperLink>

   

 My question is, is it possible to get the rel="nofollow" to appear before the href"" when the page loads?

#60197
Jul 24, 2012 16:00
Vote:
 

I think it would be a lot of hassle to change the rendering order of asp:HyperLink HTML attributes.

Change it to something where you have full control of the HTML... I don't know what your code does and why but maybe something like:

<a rel="nofollow" href="<%= GetUrl(1)%>" target="_blank">1</a>

    

#60395
Aug 07, 2012 13:38
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.