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 24, 2011 @ 18:08
    Vincent DeCapite
    0

    XSLT and Metadata

    Hi There,

    Hope someone can help me with this. We have an spot on our page where a user can enter metadata and keywords and such. On most of the pages it is pulling them in, but on our product pages its not.

    Here is the code for the product pages:

    <%@ 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:ContentPlaceHolder id="Meta" runat="server" />

    </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>

    When I roll up to the interior.master, that has the metadata in it fine.. Any help with this would be greatly appreciated.

    Thanks

  • Daniel Bardi 927 posts 2562 karma points
    Mar 24, 2011 @ 18:21
    Daniel Bardi
    0

    Remove the meta contentplaceholder in the child template.

    Because you have the meta contentplaceholder in the child, it's overriding the content in the masterpage.

    Child content will always override the master content within a contentplaceholder.

    This is assuming you have the meta data fields in the meta contentplaceholder on the masterpage

  • Vincent DeCapite 64 posts 83 karma points
    Mar 24, 2011 @ 18:26
    Vincent DeCapite
    0

    Thanks for the quick response.. I went ahead and did that but I am still not seeing the metdata being populated when I view the source. I went ahead and deleted the metadata content from the products page.. When looking at it closer, it comes down to the interior page:

    <%@ 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>

    But it won't make its way down to the products page..

  • Daniel Bardi 927 posts 2562 karma points
    Mar 24, 2011 @ 18:35
    Daniel Bardi
    0

    Move the meta data fields from instead the head contentplaceholder to just before

    Leave them inside the tags of the master template; which is in the default master contentplaceholder.

    They don't need to be instead a custom contentplaceholder.  They will trickle down fine without a contentplaceholder.

    ContentPlaceHolder 's are used only if you plan on changing the content on a child template.

  • Vincent DeCapite 64 posts 83 karma points
    Mar 24, 2011 @ 19:51
    Vincent DeCapite
    0

    I tried that, still nothing.. When I view the source they still don't show up.

  • Vincent DeCapite 64 posts 83 karma points
    Mar 24, 2011 @ 19:57
    Vincent DeCapite
    0

    Moved the two meta lines:

    <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"/>

    Still Nothing... Can you please provide an example, its trickling down fine to the interior page, its not trickling down to the product pages.

  • Daniel Bardi 927 posts 2562 karma points
    Mar 24, 2011 @ 20:04
    Daniel Bardi
    0

    add runat="server" to the head tag

    <head 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"/>

    </head>
  • Vincent DeCapite 64 posts 83 karma points
    Mar 24, 2011 @ 20:10
    Vincent DeCapite
    0

    Ok.. Then this is telling me something is seriously wrong with the website.. I went ahead and did what you said... Now my Content master page looks like this:

    <%@ 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">
    <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"/>
    <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="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>   

    Its still not moving down though past the interior page.

  • Daniel Bardi 927 posts 2562 karma points
    Mar 24, 2011 @ 20:35
    Daniel Bardi
    0

    The toplevel master template needs be wrapped inside a contentplaceholder

    <%@ 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 xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">
    </head>
    <body></body>
      </html>
    </asp:Content>

          

  • Vincent DeCapite 64 posts 83 karma points
    Mar 25, 2011 @ 12:43
    Vincent DeCapite
    0

    when i do that, my website breaks and i get this error:

    Content controls are allowed only in content page that references a master page.

Please Sign in or register to post replies

Write your reply to:

Draft