Inside <HEAD> tag of cms collection page results in the BODY in the final code

Hi everyone,
I am using dynamic cms sites for help projects (for example: https://wmf-barmherzigkeit.webflow.io/hilfsaktionen/langfristhilfe-in-somalia. Since the published site will later have a duplicate in another country, I need href code to let google know about the copies. Therefore, I added a cms content filed inside tag to place my individual href-code. For some reason, webflow writes the code wrong. The code passage ends up in the body (see screenshots).

There is another page, with a similar structure, where the code ist implemented not with a cms (https://wmf-barmherzigkeit.webflow.io/historie). There everything works fine.

Did I find a real bug on webflow or have I done anything wrong?
Looking forward to you help.

Please, see my read only link below I you want to investigate what could cause the wrong code result.

Thanks,
Dominik

Bildschirmfoto 2023-05-02 um 08.14.50
This is where the plain text should end up.


This is the cms field with plain text.


This is the result of the wrong code. The Code snippet ends up in the body NOT the head!

Here is my public share link: [LINK](Webflow - wmf-barmherzigkeit)
(how to access public share link)

The code emits into the <head> area just fine;

image

However, as you can see it’s HTML-encoded, which makes it useless here. You’ll need to decode that HTML using script in order to embed code that way.

As far as why your devtools are showing it in the body, I’ve seen this frequently as a bug in Firefox. Is that what you’re using here? Chrome is probably a better choice for devtools.

In the meantime I got Feedback from the support team – thanks a lot! This is the answer:

So the issue is that you are putting the actual meta tag into a cms field and then try to use the variable with the meta tag content in the head tag and at the moment this is not supported in Webflow.

The proper way to do this at the moment, would be to add your meta tag to the head as static text, then insert fields from the cms with static text content used for different values in the link meta tag.

For example, for the content in you screenshot which was appearing within the Body Tag, you would create a static tag in the head, then insert various fields from your CMS that may be dynamic.

See the example below where I have Add Text Field, you would replace that by clicking Add Field and select a field from your CMS to insert it’s unique value per collection item. For meta tag parts that will stay the same for each cms item, you just put the static parts and replace values that should be dynamic with CMS fields.

<link rel="Add Text Field" hreflang="Add Text Field" href="Add Text Field or URL Field" />

Then your dynamic link rel will be in the head and a republish is needed to update that on the published site.

Putting the whole tag into a cms field and trying to insert that field by itself in the head will not work.

Thank you @memetican. I got an alternative answer from the webflow support team.