Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 6 of 6

Thread: SE Meta Data

  1. #1
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Arrow SE Meta Data

    We are currently editing the source code (c#) for the show product page.
    We want to automatically have the SE meta data filled in how we want.
    What we want to do is have the title as the manufacturer name - product name then the site.

    We have changed it so it shows the site how we want but we can not get the manufacturer to show.

    Another thing we would like to do is show the lowest variant price in the description. I guess the best way to achieve all of this would be by changing the sql query.

    Code:
    using (IDataReader rs = DB.GetRS("select * from Product with (NOLOCK) where Deleted=0 and ProductID=" + ProductID.ToString(), dbconn))
    What do we need to change to achieve what we are aiming for?

    Thanks in advance.
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  2. #2
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    My suggestion (being an xml kinda guy) would be to do this in the xmlpackage for your product page rather than editing the source.........


    TTFN

    BFG

  3. #3
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    Changing the SE in the XML files?
    How can I do that? I just had a quick look though one of our product XML's and didn't really see anything standing out.

    Thanks
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  4. #4
    BFG 9000 is offline Senior Member
    Join Date
    Oct 2006
    Location
    South UK
    Posts
    882

    Default

    Here's an extract from the bottom of my product xmlpackage :-

    C#/VB.NET Code:
    <SearchEngineSettings>
    <
    SETitle actionType="transform">

            <
    xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
                <
    xsl:output method="html" omit-xml-declaration="yes" />

                <
    xsl:template match="/">
                            <
    xsl:apply-templates select="/root/Products/Product" />
                </
    xsl:template>

                <
    xsl:template match="Product">
                    <
    xsl:param name="price" select="/root/Products/Product/Price"></xsl:param>
                    <
    xsl:param name="saleprice" select="/root/Products/Product/SalePrice"></xsl:param>
                    <
    xsl:param name="sedesc" select="/root/Products/Product/SEDescription"></xsl:param>
                    <
    xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>

                    <
    xsl:param name="prodprice">
                            <
    xsl:choose>
                                <
    xsl:when test="$saleprice&gt;0">
                                    <
    xsl:value-of select="format-number(($saleprice * 1.15), '###0.00')" />
                                </
    xsl:when>
                                <
    xsl:otherwise>
                                    <
    xsl:value-of select="format-number(($price * 1.15), '###0.00')" />
                                </
    xsl:otherwise>
                            </
    xsl:choose>
                    </
    xsl:param>

                    <
    xsl:param name="setitleoutput" select="concat($pName, ' for only £',$prodprice)"></xsl:param>

                    <
    xsl:value-of select="$setitleoutputdisable-output-escaping="yes"/>

                </
    xsl:template>

            </
    xsl:stylesheet>

    </
    SETitle>
    <
    SEDescription actionType="transform">

            <
    xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
                <
    xsl:output method="html" omit-xml-declaration="yes" />

                <
    xsl:template match="/">
                            <
    xsl:apply-templates select="/root/Products/Product" />
                </
    xsl:template>

                <
    xsl:template match="Product">
                    <
    xsl:param name="price" select="/root/Products/Product/Price"></xsl:param>
                    <
    xsl:param name="saleprice" select="/root/Products/Product/SalePrice"></xsl:param>
                    <
    xsl:param name="sedesc" select="/root/Products/Product/SEDescription"></xsl:param>

                    <
    xsl:param name="prodprice">
                            <
    xsl:choose>
                                <
    xsl:when test="$saleprice&gt;0">
                                    <
    xsl:value-of select="format-number(($saleprice * 1.15), '###0.00')" />
                                </
    xsl:when>
                                <
    xsl:otherwise>
                                    <
    xsl:value-of select="format-number(($price * 1.15), '###0.00')" />
                                </
    xsl:otherwise>
                            </
    xsl:choose>
                    </
    xsl:param>

                    <
    xsl:param name="sedoutput" select="concat('Direct from the Manufacturer for only £',$prodprice,' : ',$sedesc)"></xsl:param>

                    <
    xsl:value-of select="$sedoutputdisable-output-escaping="yes"/>

                </
    xsl:template>

            </
    xsl:stylesheet>

    </
    SEDescription>
    </
    SearchEngineSettings
    It goes just befor the closing </package> tag.


    TTFN

    BFG

  5. #5
    DotNetDevelopments is offline Senior Member
    Join Date
    Jul 2008
    Location
    Harlow / Essex / UK
    Posts
    619

    Default

    worked a charm.
    Any idea how to get a pound symbol showing in the description? Every time it converts it to HTML. Not a major thing but if it could be done it would be amazing. I just changed around your code a bit to suit our needs.

    Code:
      <SearchEngineSettings>
        <SETitle actionType="transform">
    
          <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
            <xsl:output method="html" omit-xml-declaration="yes" />
    
            <xsl:template match="/">
              <xsl:apply-templates select="/root/Products/Product" />
            </xsl:template>
    
            <xsl:template match="Product">
              <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
    
              <xsl:param name="setitleoutput" select="concat(ManufacturerName, ' ', $pName, ' @ e-tradecounter.co.uk')"></xsl:param>
    
              <xsl:value-of select="$setitleoutput" disable-output-escaping="yes"/>
    
            </xsl:template>
    
          </xsl:stylesheet>
    
        </SETitle>
        <SEDescription actionType="transform">
    
          <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf">
            <xsl:output method="html" omit-xml-declaration="yes" />
    
            <xsl:template match="/">
              <xsl:apply-templates select="/root/Products/Product" />
            </xsl:template>
    
            <xsl:template name="removeHtmlTags">
              <xsl:param name="html"/>
              <xsl:choose>
                <xsl:when test="contains($html, '&lt;')">
                  <xsl:value-of select="substring-before($html, '&lt;')"/>
                  <!-- Recurse through HTML -->
                  <xsl:call-template name="removeHtmlTags">
                    <xsl:with-param name="html" select="substring-after($html, '&gt;')"/>
                  </xsl:call-template>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$html"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:template>
    
            <xsl:template match="Product">
              <xsl:param name="price" select="/root/Products/Product/Price"></xsl:param>
              <xsl:param name="saleprice" select="/root/Products/Product/SalePrice"></xsl:param>
              <xsl:param name="Summary" select="aspdnsf:GetMLValue(Summary)"></xsl:param>
              <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
    
              <xsl:param name="prodprice">
                <xsl:choose>
                  <xsl:when test="$saleprice&gt;0">
                    <xsl:value-of select="format-number(($saleprice * 1.15), '###0.00')" />
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:value-of select="format-number(($price * 1.15), '###0.00')" />
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:param>
              
              <xsl:variable name="pureText3">
                <xsl:call-template name="removeHtmlTags">
                  <xsl:with-param name="html" select="$Summary" />
                </xsl:call-template>
              </xsl:variable>
    
              <xsl:value-of select="concat('From £',$prodprice, ' ', $pName, ' - ' ,$pureText3)" disable-output-escaping="yes"/>
    
            </xsl:template>
    
          </xsl:stylesheet>
    
        </SEDescription>
      </SearchEngineSettings>
    Thanks so much for your help.

    EDIT - The html shows up fine in a search engine. Perfect! Thanks!
    EDIT 2 - New updated code now, Thanks for your help. Pretty much automated our SEO now!
    Last edited by DotNetDevelopments; 11-16-2009 at 02:48 AM. Reason: No worries!
    =====
    Version (Code/DB): AspDotNetStorefront MSx 9.1.0.1/9.1.0.0
    Execution Mode: 64 Bit
    Dot Net Developments - E-commerce By Experience

  6. #6
    ChinaToddm is offline Junior Member
    Join Date
    May 2009
    Posts
    11

    Default Meta data

    I just want to something more simple I only have 5 product category pages but they are all populate with the site default meta tags what do I need to add to the XML to make them show the SE Fields I fill in on each product category?