Copied to clipboard

Flag this post as spam?

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


  • Kevin Coster 83 posts 120 karma points
    Jun 09, 2010 @ 16:29
    Kevin Coster
    0

    Meta Tags under <head id="head" runat="server">

    Trying to get meta tags in on pages but having problems with <head id="head" runat="server"> messing around on Umbraco 4.0.3

    In the master template I have the following:

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">

    <head id="head" runat="server">

    <title><umbraco:Item field="pageName" runat="server"></umbraco:Item></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="google-site-verification" content="" />
    <meta name="description" content='<umbraco:Item field="Metadata-Description" runat="server"></umbraco:Item>' />
    <meta name="keywords" content='<umbraco:Item field="Metadata-Keywords" runat="server"></umbraco:Item>' />

    <link href="/css/style.css" rel="stylesheet" type="text/css" />

    But when I view the page I get the following come through:

    <head id="ctl00_ctl00_ctl00_ContentPlaceHolderDefault_head"><title>
    Ross Young Fitness
    </title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="google-site-verification" content="" /><meta name="description" content="&lt;umbraco:Item field=&quot;Metadata-Description&quot; runat=&quot;server&quot;>&lt;/umbraco:Item>" /><meta name="keywords" content="&lt;umbraco:Item field=&quot;Metadata-Keywords&quot; runat=&quot;server&quot;>&lt;/umbraco:Item>" /><link href="/css/style.css" rel="stylesheet" type="text/css" />

    obvously this is a problem

    &lt;umbraco:Item field=&quot;Metadata-Description&quot; runat=&quot;server&quot;>&lt;

    where I should be seing my Keywords, any advice greatly appreciated.

     

    Thanks

    Kev

     

  • Bert 128 posts 251 karma points
    Jun 09, 2010 @ 16:40
    Bert
    0

    I had the same problem once and the suggestion was: make a macro that takes the itemfields as a parameter and use that one.

    call macro:

    umbraco:Macro keywords="[$"Metadata-Keywords]" description="[$Metadata-Description]" Alias="metaInformation" runat="server" />

    macro:

    <xsl:variable name="keywords" select="/macro/keywords-parameter"/>
    <xsl:variable name="description" select="/macro/description-parameter"/>

    <xsl:template match="/">
        <meta name="keywords" content="{$keywords}" />
        <meta name="description" content="{$description}" />
    </xsl:template>
  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Jun 09, 2010 @ 16:49
    Ismail Mayat
    0

    Kevin,

    head runat server will mess up see issue i had guess this needs to be added as issue on codeplex.

    Regards

    Ismail

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Jun 09, 2010 @ 16:52
    Peter Duncanson
    0

    What are you doing to the head in your .net code to need to have runat server in there? Strip it out if you don't need it.

  • Kevin Coster 83 posts 120 karma points
    Jun 09, 2010 @ 17:19
    Kevin Coster
    0

    Is being used for runway drop down nav which actually isnt working anyway!

    so might take it out

  • Peter Duncanson 430 posts 1360 karma points c-trib
    Jun 09, 2010 @ 18:37
    Peter Duncanson
    0

    Runway sucks, use one of the navigation macros instead, much better :)

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Nov 20, 2010 @ 15:52
    Jeroen Breuer
    0

    Has this bug already been solved? Creating a macro works, but it should work without using a macro of course.

    Jeroen

  • Connie DeCinko 931 posts 1160 karma points
    Dec 21, 2010 @ 23:13
    Connie DeCinko
    0

    Agreed.  How do we get this fixed?

     

Please Sign in or register to post replies

Write your reply to:

Draft