Trouble with showing meta-description and meta-keywords
Hey guys,
I am having trouble with showing my meta-description and meta-keywords. On my document type I have defined a metaDescription property. In my master template I have added the following code in the 'head' section:
Trouble with showing meta-description and meta-keywords
Hey guys,
I am having trouble with showing my meta-description and meta-keywords. On my document type I have defined a metaDescription property. In my master template I have added the following code in the 'head' section:
" />
When I view my page source I get the following:
content=""<umbraco:Item" field="metaDescription" recursive="true" />" />
So I decided to change some double quotes to single ones. I have now the following code:
However, in my page source I still don't get the meta-description I have defined for the page but:
content="<umbraco:Item field='metaDescription' recursive='true' runat='server'></umbraco:Item>" />
Is there anybody who has encountered a similar problem and has found a solution for this?
Hans
Hi Hans,
I had the same problem a few weeks back and solved it by putting single quotes in the HTML Tag. Hope this helps you also
[code][/code]
Richard
Hi Richard,
Thanks for your reply. Unfortunately this solution didn't work for me. In de page source I still get
content="<umbraco:Item field="metaDescription" recursive="true" runat="server"></umbraco:Item>" />
Do you have any other ideas?
Hans
Hi Hans,
I had the same problem today.
Turns out I had runat="server" set on my head tag, if you remove the runat from the head tag it will work.
You can read more about it on my blog: http://munkimagik.wordpress.com/2009/02/11/gotcha-in-umbraco/
Tim
I use the macro solution provided by Richard:
http://www.richardsoeteman.net/PermaLink,guid,90e0ca4a-0e98-4962-9d86-5381d57e6ae7.aspx
[code]<meta name="Description" content="<umbraco:Item field='metaDescription' runat='server'></umbraco:Item>" />
<meta name="Keywords" content="<umbraco:Item field='metaKeywords' runat='server'></umbraco:Item>" />[/code]
Works for me! (Without runat="server" in the <head> tag.
HTH
You can use insertTextBefore and insertTextAfter
Here is yet another solution which I find nice since you can keep the head runat="server" and keep the code quite clean without < and >
Use a nameless asp:placeholder like this:
is working on a reply...