Canonical URL field in Blog Posts Collection (for syndicated blog posts)
I have created a Plain Text field called 'Canonical URL' in our 'Blog Posts' collection on our webflow website. I only set this for a one or two of our blog articles where we are using a syndicated article so we can point back to the canonical original article on the author's blog using a canonical link.
How I am trying to code this: A canonical link in HTML
<head> section ONLY for syndicated blog posts
To do this I am trying to get a rel="canonical" link into the head area using the custom code section of our blog posts template, but make this conditional i.e. if the field called 'Canonical URL' is set then there should be a
<link rel="canonical" href="www.someblog.com/someblogpost">
in the head section else it should not add anything as the href would be blank if it did. I have tried all sorts of code to try to get this working for several hours now and I have looked through all the help information and forum posts I can find but I can't find anything that matches this problem. I cannot believe that no one else has this use case as this will be a requirement for anybody that has blog posts that include at least one syndicated post (not least this is vital for SEO so syndication doesn't look like duplication).
Can you please help?