Canonical rel ="next"?
Canonical rel ="next"?
Does AC support rel ="next" and rel="prev" pagination?
I just watched a Google video that says to avoid using rel="canonical"
I just watched a Google video that says to avoid using rel="canonical"
Contractor's Solutions
www. contractors-solutions.net
www. contractors-solutions.net
Re: Canonical rel ="next"?
Currently uses rel=canonical to provide with URL information which is a good and known SEO practice. From your question it seems you are asking with respect to paged data with links? If that video is public perhaps you should shared the URL here.
Re: Canonical rel ="next"?
Yes, I am asking about things like category pages, where you typically have multiple pages of products.
Here is the video: https://www.youtube.com/watch?v=6AmRg3p ... ploademail
Here is the video: https://www.youtube.com/watch?v=6AmRg3p ... ploademail
Contractor's Solutions
www. contractors-solutions.net
www. contractors-solutions.net
Re: Canonical rel ="next"?
So, I guess AC can't do rel ="next" and rel="prev" pagination.
When I get some time, I will see if I can make it work.
When I get some time, I will see if I can make it work.
Contractor's Solutions
www. contractors-solutions.net
www. contractors-solutions.net
Re: Canonical rel ="next"?
Did you ever get this to work? We just had someone go through our website to find all technical aspects that could negatively affect Google ranking, and this is one of the biggest things that they found. I have tried to look at the files to find a way to fix this, but to no avail.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Canonical rel ="next"?
For Category Grid(Deep Item Display) Page this can be tried. First edit ConLib/CategoryGridPage.ascx.cs file and locate following code
and update it like this
Code: Select all
if (PagerPanel.Visible)
{
PagerControls.DataSource = AbleCommerce.Code.NavigationHelper.GetPaginationLinks(currentPagerIndex, totalPages, baseUrl);
PagerControls.DataBind();
}
if (PagerPanelTop.Visible)
{
PagerControlsTop.DataSource = AbleCommerce.Code.NavigationHelper.GetPaginationLinks(currentPagerIndex, totalPages, baseUrl);
PagerControlsTop.DataBind();
}
Code: Select all
List<PagerLinkData> pages = AbleCommerce.Code.NavigationHelper.GetPaginationLinks(currentPagerIndex, totalPages, baseUrl);
if (pages.Count > 1)
{
int index = pages.FindIndex(p => p.TagClass == "current");
if (index > 0)
{
PagerLinkData prev = pages[index - 1];
Page.Header.Controls.Add(new LiteralControl(string.Format("<link rel=\"prev\" href=\"{0}\">", Page.ResolveUrl(prev.NavigateUrl))));
}
if (index < pages.Count - 1)
{
PagerLinkData next = pages[index + 1];
Page.Header.Controls.Add(new LiteralControl(string.Format("<link rel=\"next\" href=\"{0}\">", Page.ResolveUrl(next.NavigateUrl))));
}
}
if (PagerPanel.Visible)
{
PagerControls.DataSource = pages;
PagerControls.DataBind();
}
if (PagerPanelTop.Visible)
{
PagerControlsTop.DataSource = pages;
PagerControlsTop.DataBind();
}
Re: Canonical rel ="next"?
From what I can find, Google is also happy if there is a 'View All' option, and will use it if it is available. That can easily be added to the CategoryGrid by adding a new 'View All' option with a value of "0".
Code: Select all
<asp:ListItem Text="View All" Value="0"></asp:ListItem>
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Canonical rel ="next"?
How do you do it for the NEW Category Grid Page4 ?
I have tried at least several times and it just breaks the page.
It says:
[[ConLib:CategoryGridPage4]] g:\Home\WWW\contract\contractors-solutions.net\wwwroot\ConLib\CategoryGridPage4.ascx.cs(328): error CS0246: The type or namespace name 'PagerLinkData' could not be found (are you missing a using directive or an assembly reference?)
I have tried at least several times and it just breaks the page.
It says:
[[ConLib:CategoryGridPage4]] g:\Home\WWW\contract\contractors-solutions.net\wwwroot\ConLib\CategoryGridPage4.ascx.cs(328): error CS0246: The type or namespace name 'PagerLinkData' could not be found (are you missing a using directive or an assembly reference?)
Contractor's Solutions
www. contractors-solutions.net
www. contractors-solutions.net
Re: Canonical rel ="next"?
OK, I think I figured it out. I had to add " using AbleCommerce.Code;" near the top.
Now the problem is, the category pages have BOTH canonical link AND rel=prev / next tags. Google advises against this:
Now the problem is, the category pages have BOTH canonical link AND rel=prev / next tags. Google advises against this:
How is the canonical link tag removed from category pages?For example, one common mistake people make is that they properly put “rel prev”, “rel next” tags on pages, but also include “rel canonical” tags on the same pages. These two tags conflict with one another, and should not be on the same page as one another.
Contractor's Solutions
www. contractors-solutions.net
www. contractors-solutions.net
Re: Canonical rel ="next"?
To remove the canonical link from category pages, open Website/App_Code/PageHelper.cs
Locate the following code
and replace with
Locate the following code
Code: Select all
string canonicalFormat = "<link rel=\"canonical\" href=\"{0}\" />";
string objectUrl = storeUri.Scheme + "://" + storeUri.Authority + page.ResolveUrl(catalogObject.NavigateUrl);
objectUrl = objectUrl.Replace("/mobile/", "/");
htmlHead.Append(string.Format(canonicalFormat, objectUrl));
Code: Select all
if (catalogObject.CatalogNodeType != CatalogNodeType.Category)
{
string canonicalFormat = "<link rel=\"canonical\" href=\"{0}\" />";
string objectUrl = storeUri.Scheme + "://" + storeUri.Authority + page.ResolveUrl(catalogObject.NavigateUrl);
objectUrl = objectUrl.Replace("/mobile/", "/");
htmlHead.Append(string.Format(canonicalFormat, objectUrl));
}