Hi DynamicWeb,
I have issues with duplicate canonical rendered on my pages.
Here is what I have and done so far, and what I want to achieve. We need to have canonical on all pages (content pages, eComm group pages, eComm product pages), even if the Canonical property in Meta section is empty we want SearchFriendlyURL to be shown as canonical.
I have some custom logic in PageTemplateExtender for getting canonical and adding it. So scenario would be, if Canonical meta property is not empty (for content pages, eComm groups, eComm products) use it as canonical, else use PageView.SearchFriendlyURL as canonical.
In the end I just add that canonical with following line of code:
this.PageView.Meta.Add(String.Format("<link rel='canonical' href='{0}' />", canonicalURL));
I unchecked "Canonical link in meta" checkboxes in Managnent Center -> Web and HTTP -> Customized URLs both in eCommerce and Meta sections. With this setting and custom code for adding canonical in PageTemplateExtender I am trying to achive that only I control adding and rendering of canonical on pages.
The first issue is that i get 2 same canonicals on product page. You can check on http://195.249.142.64/webshop/bosch-tka8013
The second issue is strange, on frontpage I get 2 canonicals, one from page and other from that bosch product. All screenshoots are attached.
What am I doing wrong? Is there a way to change or remove this.PageView.Meta object (as I saw it is not public, and you can only Add)?
Please advise.
Kind regards,