Developer forum

Forum » Ecommerce - Standard features » DW 8.9.1.7 - Canonical on products not rendered

DW 8.9.1.7 - Canonical on products not rendered

René Poulsen
René Poulsen
Reply

Hi,

I have a solution where I want to put canonical on some products because they are actually variants of other products (in eCom they are just regular products and NOT variants), but when I put something in the field in eCom it's not rendered in the frontend. I have @GetString("MetaTags") in my master template (because i have data-settings="disable-parsing:true" on the head tag).

If I write out TemplateTags() on the product, the field is empty so it makes sense that it doesn't appear in the header. But why is it empty? The URL entered in the canonical-field is different from the url of the product, so it's not beacause the canonical is identical to the actual URL of the product.

Any ideas / explanations ?


Replies

 
Nicolai Pedersen
Reply

Hi René

If the calculated canonical of a product is the same as the URL, it will never render it out. But if they are different, canonical should be rendered - and if one is manually specified, that will be used instead of the calculated. So that will not work for your scenario.

A simple solution is to create a custom field for canonical and use snippets in layout template and product template to move the information around: https://doc.dynamicweb.com/template-tags/introduction/helper-tags/snippets

Or if it is Razor, you might be able to use PageView.Current().Meta.Add("CustomCan", "your canonical")

BR Nicolai

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

Hi René

Make sure that you have enabled "Canonical link in meta" under the Ecommerce section in Management Center > Web and HTTP > Customized URLs

Votes for this answer: 1
 
René Poulsen
René Poulsen
Reply

Off course Morten - excactly what was missing. All those checkboxes ;-)

Thank you.

 

You must be logged in to post in the forum