Copied to clipboard

Flag this post as spam?

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


  • Vincent DeCapite 64 posts 83 karma points
    Mar 28, 2011 @ 13:56
    Vincent DeCapite
    0

    Meta Data Not Populating Down

    Hi,

    I really need some help with this and I am not sure where to go. We have fields in our umbraco system where a user can enter metadata and metakeywords. On the first level of templates the keywords and metadata are getting entered fine. As soon as it reaches the products page, its not being entered whatsoever. I have played around with this for a few hours and no luck. I have included the templates below and hope someone can help me.

    Thanks again!

    Content Master:

    <%@ Master Language="VB" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <asp:ContentPlaceHolder Id="PageTitle" runat="server">
     <!--<title><umbraco:Item runat="server" field="metaPageTitle" recursive="true" insertTextAfter=" | " /><umbraco:Item runat="server" field="siteName" recursive="true" /></title>-->
     <umbraco:Macro Alias="WSC.MetaTitle" runat="server"></umbraco:Macro>
    </asp:ContentPlaceHolder>
    <asp:ContentPlaceHolder Id="MetaData" runat="server">
    <umbraco:Item field="metaKeywords" insertTextBefore="&lt;meta name=&quot;keywords&quot; content=&quot;" insertTextAfter="&quot; /&gt;" recursive="true" runat="server"/>  
    <umbraco:Item field="metaDescription" insertTextBefore="&lt;meta name=&quot;description&quot; content=&quot;" insertTextAfter="&quot; /&gt;" recursive="true" runat="server"/>
    </asp:ContentPlaceHolder>
    <asp:ContentPlaceHolder id="Meta" runat="server" />
    <link rel="stylesheet" href="/inc/style/reset.css" type="text/css" />
    <link rel="stylesheet" href="/inc/style/base.css" type="text/css"/>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
    <script type="text/javascript" src="/inc/js/jquery.cookie.js"></script>
    <script type="text/javascript" src="/inc/js/functions.js"></script>
    <asp:ContentPlaceHolder id="Head" runat="server" />
    <link rel="stylesheet" href="/inc/style/print.css" type="text/css" media="print" />
    <link rel="shortcut icon" href="/favicon.ico">
    </head>
    <body>
    <div id="canvas">
    <div id="wrapper">
     <div id="header">
         <a href="/" class="logo">us endoscopy</a>
     <form method="get" action="<umbraco:Macro nodeID='1078' Alias='NiceUrl' runat='server' />" id="search">
      <input type="text" name="search" value="Search" class="text default-value" />
      <input type="image" name="submit" class="btnSearch" value="Search" src="/elements/spacer.gif" />
     </form>
           
            <ul class="tools">
                <li><a href="<umbraco:Macro nodeID='1079' Alias='NiceUrl' runat='server' />">How to order</a></li>
                <li><a href="<umbraco:Macro nodeID='1080' Alias='NiceUrl' runat='server' />">Email Sign up</a></li>
            </ul>
     
     <!-- AddThis Button BEGIN -->
     <a class="addthis_button" href="http://addthis.com/bookmark.php?v=250&amp;username=enoscopy"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=enoscopy"></script>
     <!-- AddThis Button END -->
     
            <umbraco:Macro location="Top" level="2" css="navigation" ancestorAlias="" nodeID="" Alias="WSC.Navigation" runat="server"></umbraco:Macro>
         </div>
         <div id="content" class="clearfix">
          <div id="left">
                    <asp:ContentPlaceHolder Id="Body" runat="server" />   
            </div><!-- End #left -->
            <div id="right">
             <div class="content">
                    <asp:ContentPlaceHolder Id="Right" runat="server" />   
                </div>
            </div>
      </div><!-- End #content -->
         <div id="footer">
          <umbraco:Macro location="Bottom" level="" css="navigation" ancestorAlias="" nodeID="" Alias="WSC.Navigation" runat="server"></umbraco:Macro>
            <div class="copyright"><a href="<umbraco:Macro nodeID='2814' Alias='NiceUrl' runat='server' />">&copy;<umbraco:Item field="pageName" runat="server" xslt="Exslt.ExsltDatesAndTimes:year()" /> US Endoscopy.</a> All Rights Reserved.</div>
            <div class="update">Page Last Updated <umbraco:Macro Alias="WSC.UpdateDate" runat="server" /></div>
         </div>
    </div><!-- End #canvas -->
    </div><!-- End #wrapper -->
    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    try {
    var pageTracker = _gat._getTracker("UA-10065745-1");
    pageTracker._trackPageview();
    } catch(err) {}
    </script>
    </body>
    </html>   

    Interior Master:

     <%@ Master Language="C#" MasterPageFile="/masterpages/ContentMaster.master" AutoEventWireup="true" %>
    <asp:content ContentPlaceHolderId="Head" runat="server">
     <asp:ContentPlaceHolder Id="Head" runat="server" />
    </asp:content>

    <asp:content ContentPlaceHolderId="Body" runat="server">
     <umbraco:Macro showHome="1" separator=" / " Alias="WSC.Breadcrumb" runat="server"></umbraco:Macro>
     <form runat="server">
     <asp:ContentPlaceHolder Id="Body" runat="server">
      <umbraco:Item field="bodyText" runat="server"></umbraco:Item>
     </asp:ContentPlaceHolder>
     </form>
    </asp:content>
    <asp:Content ContentPlaceHolderId="Right" runat="server">
     <umbraco:Macro Alias="WSC.ProductSearch.Widget" runat="server"></umbraco:Macro>
     <div class="ads">
     <umbraco:Macro source="1100" ads="2" imageWidth="189" Alias="WSC.Ads" runat="server"></umbraco:Macro>
     </div>
    </asp:Content>

    Product Master: (Metadata not coming down to this level)

     <%@ Master Language="C#" MasterPageFile="/masterpages/Interior.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderId="Head" runat="server">
     <link rel="stylesheet" href="/inc/style/product.css" type="text/css"/>
    </asp:Content>

    <asp:Content ContentPlaceHolderID="Body" runat="server">
     <asp:ContentPlaceHolder Id="Body" runat="server">
      <umbraco:Macro Alias="WSC.Product" runat="server"></umbraco:Macro>
     </asp:ContentPlaceHolder>
    </asp:Content>
  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 28, 2011 @ 14:31
    Tom Fulton
    0

    Hi,

    What version of Umbraco are you using?  I think there was a bug in older versions (4.0.3?) where umbraco:Item tags would only work from their direct (child) template and not in inherited masters.  In this case you could use an XSLT macro instead to render them instead.

    If this isn't the case, do you actually have metadata entered on the Product pages or are you expecting it to pull recursively?  Does it pull if you enter something in a Product page?

    -Tom

  • Vincent DeCapite 64 posts 83 karma points
    Mar 28, 2011 @ 14:31
    Vincent DeCapite
    0

    I tried using this code in the product template:

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

    But all this gives me is the empty tag, it does not populate any of the data from the text boxes.. Any help would be greatly appreciated!

    Thanks

  • Vincent DeCapite 64 posts 83 karma points
    Mar 28, 2011 @ 14:33
    Vincent DeCapite
    0

    Thanks For The Quick Reply Tom. I am using umbraco version 4.0.3. On our product page, we have different tabs, one tab is where the user can enter metdata and meta keywords. The data is actually entered on the product pages itself and I need to pull that in

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 28, 2011 @ 14:44
    Tom Fulton
    0

    Are you sure you have the metaDescription entered within the correct field names on the Product pages?

    You might double check by viewing the raw XML for a product page and verifying there is a <data alias="metaDescription"> tag there that is populated.  You can check this by either:

    - Check the umbraco.config file and find a product page
    - Use the XMLDump package to verify this
    - Create an XSLT macro to dump out the XML from currentPage and insert it into your product template.  The XSLT code would just be: <textarea><xsl:copy-of select="$currentPage"/></textarea>

    -Tom

  • Vincent DeCapite 64 posts 83 karma points
    Mar 28, 2011 @ 15:36
    Vincent DeCapite
    0

    Hi Tom,

     

    Just looked at the umbraco.config file and the names are still the same, it also looks like the information is being populated in there, but it does not come out in Internet explorer when the view page source is done. Here is what the log says:

    <

     

    data alias="productRelated"><![CDATA[1310,2621]]></data>

    <

     

    data alias="metaPageTitle" />

    <

     

    data alias="metaDescription"><![CDATA[Biovac How It Works, Biovac Video, Biovac How It Works Video]]></data>

    <

     

    data alias="metaKeywords"><![CDATA[00711511, 00711512, 00711513, BX00711511, BX00711512, BX00711513]]></data>

    <

     

    data alias="productVideos"><![CDATA[2943,2962,3027]]></data>

    <

     

    data alias="productAnimation1" />

    <

     

    data alias="productRelatedCategory"><![CDATA[2550,2554]]></data>

    <

     

    data alias="productDocumentType">Spec Sheet (US),Spec Sheet (International),IFU,Case Report,Checklist,Quick Reference Guide,White Paper</data>

    <

     

    data alias="bodyText"><![CDATA[

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 28, 2011 @ 16:11
    Tom Fulton
    0

    Weird.

    Is the content from your MetaData placeholder coming down at all?  IE are you seeing the actual Meta tags on product pages and they are just blank?  Or if you enter some static content in the template inside the MetaData placeholder do you see it at all on your product pages? 

    If it is coming down properly and just not rendering the field content, how about trying an XSLT macro instead of the <umbraco:item> tags to render your Meta Tags?  Worth a try.  Something like:

     

    <meta name="keywords">
    <xsl:attribute name="content">
    <xsl:value-of select="$currentPage/data [@alias = 'metaKeywords']"/>
    </xsl:attribute>
    </meta>
    <meta name="description">
    <xsl:attribute name="content">
    <xsl:value-of select="$currentPage/data [@alias = 'metaDescription']"/>
    </xsl:attribute>
    </meta>

    If you want to make them recursive I think you could replace with something like:

    <xsl:value-of select="$currentPage/ancestor-or-self::node [data [@alias = 'metaDescription'] != '']"/>

     

    -Tom

  • Vincent DeCapite 64 posts 83 karma points
    Mar 28, 2011 @ 18:44
    Vincent DeCapite
    0

    When I view the source on the page this is what I am getting:

    <link rel="stylesheet" href="/inc/style/reset.css" type="text/css" /><link rel="stylesheet" href="/inc/style/base.css" type="text/css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
    <script type="text/javascript" src="/inc/js/jquery.cookie.js"></script>
    <script type="text/javascript" src="/inc/js/functions.js"></script>
    <link rel="stylesheet" href="/inc/style/product.css" type="text/css"/>
    <meta name="description" content="" />

    As you can see its just the empty tag.. Is the XSLT the only way of doing it? Its populating the rest of the site fine until it hits this product level.

  • Sean Mooney 131 posts 158 karma points c-trib
    Mar 28, 2011 @ 19:07
    Sean Mooney
    0

    Vince, 

    In the product page in Umbraco is there a field with an alias of metaDescription? 

  • Vincent DeCapite 64 posts 83 karma points
    Mar 28, 2011 @ 19:07
    Vincent DeCapite
    0

    Yes there is. It works for every section except the product pages

  • Sean Mooney 131 posts 158 karma points c-trib
    Mar 28, 2011 @ 19:16
    Sean Mooney
    0

    You might want to look at the urlRewriting file, the way the products area works is a little different. you might need to do the meta information differently on the product template than the other templates.

    -Sean

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 28, 2011 @ 19:33
    Tom Fulton
    0

    I don't think XSLT is the only way of doing it, but it would be a good step for troubleshooting.  If it's not working in XSLT you've got some bigger problems :)  Plus if it's not working in XSLT you can do copy-of's to see what XML we are getting and help troubleshoot.

  • Daniel Bardi 927 posts 2562 karma points
    Mar 28, 2011 @ 19:40
    Daniel Bardi
    0

    Have you tried adding the recursive="true" attribute to see if parent meta data trickles down.. might give you some idea if it's a problem with the template structure or just a problem with the page properties.

Please Sign in or register to post replies

Write your reply to:

Draft