Copied to clipboard

Flag this post as spam?

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


  • Tushar Vaja 12 posts 32 karma points
    Sep 07, 2011 @ 12:03
    Tushar Vaja
    0

    head runat="server" problem for umbraco:Item in meta tag

    I am using master document type for Umbraco

    there is one property called metaDescription.

    I want to render MetaDescription as following

    <meta name="description" content="" />


    I have tried following

    <meta name="description" content="<umbraco:Item field='metaDescription' runat='server'></umbraco:Item>" />

    its not working for me it render following

    <meta name="description" content="&lt;umbraco:Item field='metaDescription' runat='server'>&lt;/umbraco:Item>" />

    if I remove runat="server" attribute from head tag than its working fine.

    any solution please..

    Thanking you in advanced

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 07, 2011 @ 12:46
    Dirk De Grave
    0

    tushar,

    this is because you're using double quotes for both the name attribute and your umbraco field, can't be done that way. Should follow Richard's advice on his blog post

     

    Cheers,

    /Dirk

  • Tushar Vaja 12 posts 32 karma points
    Sep 07, 2011 @ 12:53
    Tushar Vaja
    0

    Thanks Dirk for quick reply but for name attribute I have used double quates but not for umbraco field.

    content="<umbraco:Item field='metaDescription' runat='server'></umbraco:Item>"

    /Tushar

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 07, 2011 @ 13:04
    Dirk De Grave
    0

    Still, the same solution should be applied..; unless you use the textBefore and textAfter options when inserting the field from the dialog (make sure to escape any html character then)

     

    Cheers,

    /Dirk

  • Tushar Vaja 12 posts 32 karma points
    Sep 07, 2011 @ 13:08
    Tushar Vaja
    0

    Thanks Dirk,

    This work for me

      <umbraco:Item field="metaDescription" insertTextBefore="&lt;meta name=&quot;description&quot; content=&quot;" insertTextAfter="&quot; /&gt;" runat="server"></umbraco:Item>

    Thanks again for your quick reply..

     

Please Sign in or register to post replies

Write your reply to:

Draft