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
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
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
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
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
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
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
@Alexander, are you sure? http://support.google.com/webmasters/bin/answer.py?hl=en&answer=96569
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.
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?
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>
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