Developer forum

Forum » Ecommerce - Standard features » Canonical link in meta

Canonical link in meta

Adrian Ursu
Reply

Hi Guys,

I have this situation:

2 websites on the same solution. One of the websites displays canonical URL correctly in product detail page, the other one does not.

For both solutions I am using    @GetValue("MetaTags") in the master page for getting the meta attributes.

Both have, obviously, the same URL settings.

Main difference is how the Product catalog is used.

First one (that does not display the canonical) has a generic Catalog page, with ecom navigation and product catalog

Second one (that does display canonical link in product detail page) has separate pages for the main ecom sections, each page has ecom navigation and product catalog.

Both product catalogues have "Use first page in list as canonical URL" activated.

What I have noticed is that if I set something on the canonical attribute of the Catalog page, it is displayed. This makes me think that the system does not see the Product Detail page as an ecom Product Detail page but rather as a regular page.

I am using 8.7.2.2.

The bad example is :http://www.aperta.ro/catalog/articole-birou/lipiciuri-accesorii-birou/lipici-vinil-fix

The good example is: http://austral.dotfusion.ro/arhivare/arhivare/alonje/alonje-25-set (although the canonical link is not friendly)

Thanks,

Adrian


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

It will only display a canonical if the URL in which the product is being shown is different from the canonical.

So if a product is member of 2 groups, and one is set as primary group, and you then display the product in group 2 (the one which is not primary), it will add a canonical to the URL for the product on the primary group.

So if you only have one page and a product member of only one group, and all of it is displayed in the right path - no canonical will be rendered - it is not needed.

BR Nicolai

 
Adrian Ursu
Reply

Right. 

It totally makes sense.

Thank you very much.

Adrian

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I am reopening this thread since it does not seem to work right, or I am missing a setting.

I have noticed Rapido templates are not rendering by default the meta tags. Therefore I have added the @Model.MetaTags value in the header and they are now rendered.

But it does not seem to render the correct value for the canonical. Based on the definition you have provided, the canonical should be rendered in the secondary (alternative) link for the product.

Righ now, it seems that it is indeed rendered only on the secondary page but it has the same value as the secondary page instead of  having the value fo the Primary page.

See attachments.

Thank you,
Adrian

canonical-1.png canonical-2.png
 
Nicolai Pedersen
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I did. If you look at the printscreens above, you will notice the canonical is rendered but it's wrong. Everything is fine except for the part that is connected with the page.

The canonical link is supposed to be "/produkty/ocelove-kotvy..." but instead it is rendered as "/profesie/ocelove-kotvy...".

It is basically using the page id from the context where it needs to render the canonical link.

Thank you,

Adrian

 

 
Nicolai Pedersen
Reply

If you look at the print screens in the guide, you will notice they are correct.

Try setting up like I do in the guide and see if that will do it for you.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I see what you mean. The primary page on the group will control the page included in the URL.

Unfortunately, I cannot test it again since I had to go another path already.

But if that setting does what I think it should do, the Canonicla should be rendered correctly.

In which case I am happy to be proven wrong.

Thank you,

Adrian

 

You must be logged in to post in the forum