Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • hans 13 posts 20 karma points
    Jan 26, 2009 @ 11:26
    hans
    0

    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

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jan 26, 2009 @ 11:38
    Richard Soeteman
    0

    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

  • hans 13 posts 20 karma points
    Jan 26, 2009 @ 12:22
    hans
    0

    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

  • Tim 225 posts 690 karma points
    Feb 11, 2009 @ 16:19
    Tim
    0

    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

  • Bert 128 posts 251 karma points
    Aug 04, 2009 @ 12:43
  • SiKo279 82 posts 238 karma points
    Aug 04, 2009 @ 16:39
    SiKo279
    0

    [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

  • Petr Snobelt 923 posts 1535 karma points
    Aug 05, 2009 @ 08:33
    Petr Snobelt
    0

    You can use insertTextBefore and insertTextAfter

    <umbraco:Item field="pageName" 
    insertTextBefore="&lt;meta name=&quot;keywords&quot; content=&quot;" insertTextAfter="&quot; /&gt;" runat="server" />
  • toth3max 2 posts 22 karma points
    Mar 07, 2010 @ 17:45
    toth3max
    0

    Here is yet another solution which I find nice since you can keep the head runat="server" and keep the code quite clean without &lt; and &gt;

    Use a nameless asp:placeholder like this:

    <asp:placeholder runat="server">
    <meta name="description" content='<umbraco:Item field="metaDescription" recursive="true" runat="server"></umbraco:Item>' />
    <meta name="keywords" content='<umbraco:Item field="metaKeywords" recursive="true" runat="server"></umbraco:Item>' /> </asp:placeholder>

     

Please Sign in or register to post replies

Write your reply to:

Draft