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 46 of 46

Thread: xmlpackage to add Facebook 'Like' buttons & OG tags with bonus rel-canonical support

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

    Lightbulb xmlpackage to add Facebook 'Like' buttons & OG tags with bonus rel-canonical support

    Hi Guys,

    I spent a little while last night throwing this lot together & have seen some discussion around it, so I thought I'd share....

    First here's what it does, then I'll tell you how to install it.

    1. It adds a Facebook 'Like' button (more here) to each of your product pages, you'll see an example on the product pages at http://www.3mselect.co.uk/.
    2. It adds the necessary og tags (more here) into the header of the page - this is to ensure that Facebook show the correct image for your product rather than guessing - which in my experience - it gets wrong - a lot.
    3. It also adds an optional rel-canonical tag for product & category pages - this has a useful SEO benefit - more here.


    Here's an example of the tags it adds to your header :-
    HTML Code:
    <!-- start of BFG Facebook XML Package -->
    <link rel="canonical" href="http://www.sitename.co.uk/p-123-my-great-product-name-here.aspx" />
    <meta property="og:title" content="My Great Product Name Here" />
    <meta property="og:type" content="product" />
    <meta property="og:image" content="http://www.sitename.co.uk/images/Product/medium/123.jpg" />
    <meta property="og:url" content="http://www.sitename.co.uk/p-123-my-great-product-name-here.aspx" />
    <meta property="og:description" content="This is the first 250 characters of my really great product description, It's important to note that all html has been stripped out leaving just pure text." />
    <meta property="og:site_name" content="Site Name" />
    <meta property="fb:admins" content="555221822" />
    <link rel="image_src" href="http://www.sitename.co.uk/images/Product/medium/1466.jpg" />
    <!-- end of BFG Facebook XML Package -->
    Here's how to install it :-


    1. Edit the <html> tag at the top of your template to look like the following :-
    HTML Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
    This is the bit I've added :-
    xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"

    2. Add the following just before the closing </head> section of your template :-
    HTML Code:
    <!-- start of BFG Facebook XML Package -->
    (!XmlPackage Name="facebook"!)
    <!-- end of BFG Facebook XML Package -->
    3. Modify the stylesheet tag in your product xmlpackage to look like this :-
    HTML Code:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf" xmlns:fb="http://www.facebook.com/2008/fbml">
    This is the bit I've added :-
    xmlns:fb="http://www.facebook.com/2008/fbml"

    4. Add the following to your product xmlpackage whereever you want the Facebook Like button to appear (change en-GB to whatever your locale is - e.g. en-US - Also change the url to match your own, & modify the width if need be.) :-
    HTML Code:
    <xsl:param name="pLink" select="aspdnsf:ProductLink(ProductID, SEName, 0)" />
    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: 'your app id', status: true, cookie: true,
                 xfbml: true});
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_GB/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    <div style="width:450px">
    <fb:like href="http://www.sitename.co.uk/{$pLink}" show_faces="false" width="450" font="verdana"></fb:like><br />
    </div>
    5. Finally, here's the xmlpackage - you'll need to save this as facebook.xml.config & upload it to your xmlpackages directory :-

    HTML Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="BFGs Facebook / rel canonical package" debug="false" includeentityhelper="false" allowengine="true">
    
        <query name="Products" rowElementName="Product">
            <sql>
                <![CDATA[
                    SELECT Name, Description FROM Product WHERE ProductID = @ProductID
                ]]>
            </sql>
            <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
        </query>
    
    
        <PackageTransform>
            <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="xml" omit-xml-declaration="yes" />
    
                <xsl:template match="/">
    
    <!-- start of edit this to show your domain - N.B. don't forget the slash at the end -->
    <xsl:param name="site">http://www.sitename.co.uk/</xsl:param>
    <!-- end of edit this to show your domain - N.B. don't forget the slash at the end -->
    
    
    <!-- start of setting the canonical link for category & product pages -->
    			<xsl:param name="canonical">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/pagenum)"><xsl:value-of select="$site"/>c-<xsl:value-of select="/root/QueryString/categoryid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx?pagenum=<xsl:value-of select="/root/QueryString/pagenum"/></xsl:when>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)"><xsl:value-of select="$site"/>c-<xsl:value-of select="/root/QueryString/categoryid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx</xsl:when>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>p-<xsl:value-of select="/root/QueryString/productid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the canonical link for category & product pages -->
    				
    <!-- start of setting the image link for product pages -->
    			<xsl:param name="image_link">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>images/Product/medium/<xsl:value-of select="/root/QueryString/productid"/>.jpg</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the image link for product pages -->
    				
    <!-- start of setting the product name for product pages -->
    			<xsl:param name="prod_name">
    				<xsl:choose>
    <xsl:when test="boolean(/root/Products/Product/Name)"><xsl:value-of select="/root/Products/Product/Name"/></xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the product name for product pages -->
    				
    				
    <!-- start of setting the product description for product pages (including stripping html tags) -->
    <xsl:param name="ProductDesc" >
    <xsl:value-of select="/root/Products/Product/Description" disable-output-escaping="yes" />
    </xsl:param>        
    	<xsl:variable name="pureText">
                <xsl:call-template name="removeHtmlTags">
                    <xsl:with-param name="html" select="$ProductDesc"/>
                </xsl:call-template>
            </xsl:variable>
    <xsl:variable name="FBDesc" ><xsl:value-of select="substring($pureText, 0, 250)" /></xsl:variable>  
    <!-- end of setting the product description for product pages (including stripping html tags) -->
    
    <!-- start of rel canonical DELETE THIS IF YOU DON'T WANT IT -->	
    <xsl:choose>
    <xsl:when test="$canonical != 0">
    <link rel="canonical" href="{$canonical}" />
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    <!-- end of rel canonical DELETE THIS IF YOU DON'T WANT IT -->
    	
    	
    <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->	
    <xsl:choose>
    <xsl:when test="$image_link != 0">
    <meta property="og:title" content="{$prod_name}"/>
    <meta property="og:type" content="product"/>
    <meta property="og:image" content="{$image_link}"/>
    <meta property="og:url" content="{$canonical}"/>
    <meta property="og:description" content="{$FBDesc}"/>
    <meta property="og:site_name" content="Site Name"/>
    <meta property="fb:admins" content="555221822"/>
    <link rel="image_src" href="{$image_link}" />
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->	
    	
    	
                </xsl:template>
    	    
    	    
                
    <!-- start of template to strip html tags -->	
    <xsl:template name="removeHtmlTags">
        <xsl:param name="html"/>
        <xsl:choose>
          <xsl:when test="contains($html, '&lt;')">
            <xsl:value-of select="substring-before($html, '&lt;')"/>
            <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>	    
    <!-- end of template to strip html tags -->
    	    
            </xsl:stylesheet>
        </PackageTransform>
    </package>


    The xmlpackage is fairly well commented, but please shout if you have problems.



    TTFN

    BFG
    Last edited by BFG 9000; 03-26-2011 at 10:02 AM. Reason: Typo

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Looks good.

    ...another couple of ways to strip HTML from a field:

    1. Simple. Call the XSLT aspdnsf:StripHtml(string) function

    2. Write your own C# method within the XML Package. This same trick can be used to implement loads of custom functionality in XML Packages without the overhead of writing your own XSLT Extensions.

    In your XML Package, include some code like this within the <xsl:stylesheet> block (this particular example also includes code to get rid of ASCII characters that cause XML processing to fail):

    Code:
    <msxsl:script language="C#" implements-prefix="scripts">
    	    <![CDATA[   			
                   public static string MyStripHtml(String s)
                  {
                      return Regex.Replace(s, @"<(.|\n)*?>", string.Empty, RegexOptions.Compiled);
            }
    
    
    			public static string CleanInvalidXmlChars(string text)
    			{
    				// From xml spec valid chars:
    				// #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]    
    				string re = @"[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]";
    				return Regex.Replace(text, re, "");
    			}
    	      ]]>
    </msxsl:script>
    At the top of your XML package, change the <xsl:stylesheet> declaration to this so that it references both msxsl and your script:

    Code:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:aspdnsf="urn:aspdnsf" xmlns:scripts="urn:scripts.this" exclude-result-prefixes="aspdnsf">
    Now, you can call your function from within the XML Processing like this:

    Code:
    <xsl:value-of select="scripts:MyStripHtml($MyProductDescriptionVariable)"  />

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

    Default

    Now that is nice - & I can't believe I never knew about aspdnsf:StripHtml !
    I guess it's true that you learn something every day.

    Also - why on earth are we both working on a Sunday morning


    TTFN

    BFG

  4. #4
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Lol. Just shows that ASPDNSF needs better documentation.

    Is it Sunday already? Must get some light.

  5. #5
    deanfp is offline Senior Member
    Join Date
    May 2009
    Location
    Sweden
    Posts
    556

    Default

    Hi Nice code and trying to add this to a dev site.

    Just one question...

    In the facebook.xml.config file do these lines refer to the website name or facebook site? same for admin? sorry for being vague!

    <meta property="og:site_name" content="Site Name"/>
    <meta property="fb:admins" content="555221822"/>

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

    Default

    The site name is for your ecommerce site - in my case I used "3M Select".
    The fb:admins are the facebook IDs of those that you want to administer the facebook pages.


    TTFN

    BFG

  7. #7
    macecase is offline Member
    Join Date
    Feb 2011
    Posts
    44

    Default

    Thanks for sharing. I am getting an error.

    The log shows two errors when trying to view a product:

    Code:
    Source:AspDotNetStorefrontCore 
    Message:Error Calling XSLTExtension Function ProductLink: Invalid value specified for ProductID () 
    Stack Trace: 
    at AspDotNetStorefrontCore.InputValidator.ReportError(String ParamName, String ParamValue) 
    at AspDotNetStorefrontCore.InputValidator.ValidateInt(String ParamName, String ParamValue) 
    at AspDotNetStorefrontCore.XSLTExtensionBase.ProductLink(String sProductID, String sSEName, String sIncludeATag)
    and
    Code:
    Message:Error Calling XSLTExtension Function ProductLink: Invalid value specified for ProductID ()
    I am guessing the (!XmlPackage Name="facebook"!) I placed right before the </head> of my template is the cause... because it puts (!XmlPackage Name="facebook"!) on every page in text.... So, I'm guessing that is related.

    Any thoughts?



    Quote Originally Posted by BFG 9000 View Post
    Hi Guys,

    I spent a little while last night throwing this lot together & have seen some discussion around it, so I thought I'd share....

    First here's what it does, then I'll tell you how to install it.

    1. It adds a Facebook 'Like' button (more here) to each of your product pages, you'll see an example on the product pages at http://www.3mselect.co.uk/.
    2. It adds the necessary og tags (more here) into the header of the page - this is to ensure that Facebook show the correct image for your product rather than guessing - which in my experience - it gets wrong - a lot.
    3. It also adds an optional rel-canonical tag for product & category pages - this has a useful SEO benefit - more here.


    Here's an example of the tags it adds to your header :-
    HTML Code:
    <!-- start of BFG Facebook XML Package -->
    <link rel="canonical" href="http://www.sitename.co.uk/p-123-my-great-product-name-here.aspx" />
    <meta property="og:title" content="My Great Product Name Here" />
    <meta property="og:type" content="product" />
    <meta property="og:image" content="http://www.sitename.co.uk/images/Product/medium/123.jpg" />
    <meta property="og:url" content="http://www.sitename.co.uk/p-123-my-great-product-name-here.aspx" />
    <meta property="og:description" content="This is the first 250 characters of my really great product description, It's important to note that all html has been stripped out leaving just pure text." />
    <meta property="og:site_name" content="Site Name" />
    <meta property="fb:admins" content="555221822" />
    <link rel="image_src" href="http://www.sitename.co.uk/images/Product/medium/1466.jpg" />
    <!-- end of BFG Facebook XML Package -->
    Here's how to install it :-


    1. Edit the <html> tag at the top of your template to look like the following :-
    HTML Code:
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml">
    This is the bit I've added :-
    xmlnsg="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"

    2. Add the following just before the closing </head> section of your template :-
    HTML Code:
    <!-- start of BFG Facebook XML Package -->
    (!XmlPackage Name="facebook"!)
    <!-- end of BFG Facebook XML Package -->
    3. Modify the stylesheet tag in your product xmlpackage to look like this :-
    HTML Code:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf" xmlns:fb="http://www.facebook.com/2008/fbml">
    This is the bit I've added :-
    xmlns:fb="http://www.facebook.com/2008/fbml"

    4. Add the following to your product xmlpackage whereever you want the Facebook Like button to appear (change en-GB to whatever your locale is - e.g. en-US - Also change the url to match your own, & modify the width if need be.) :-
    HTML Code:
    <xsl:param name="pLink" select="aspdnsf:ProductLink(ProductID, SEName, 0)" />
    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: 'your app id', status: true, cookie: true,
                 xfbml: true});
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_GB/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    <div style="width:450px">
    <fb:like href="http://www.sitename.co.uk/{$pLink}" show_faces="false" width="450" font="verdana"></fb:like><br />
    </div>
    5. Finally, here's the xmlpackage - you'll need to save this as facebook.xml.config & upload it to your xmlpackages directory :-

    HTML Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="BFGs Facebook / rel canonical package" debug="false" includeentityhelper="false" allowengine="true">
    
        <query name="Products" rowElementName="Product">
            <sql>
                <![CDATA[
                    SELECT Name, Description FROM Product WHERE ProductID = @ProductID
                ]]>
            </sql>
            <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
        </query>
    
    
        <PackageTransform>
            <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="xml" omit-xml-declaration="yes" />
    
                <xsl:template match="/">
    
    <!-- start of edit this to show your domain - N.B. don't forget the slash at the end -->
    <xsl:param name="site">http://www.sitename.co.uk/</xsl:param>
    <!-- end of edit this to show your domain - N.B. don't forget the slash at the end -->
    
    
    <!-- start of setting the canonical link for category & product pages -->
    			<xsl:param name="canonical">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/pagenum)"><xsl:value-of select="$site"/>c-<xsl:value-of select="/root/QueryString/categoryid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx?pagenum=<xsl:value-of select="/root/QueryString/pagenum"/></xsl:when>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)"><xsl:value-of select="$site"/>c-<xsl:value-of select="/root/QueryString/categoryid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx</xsl:when>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>p-<xsl:value-of select="/root/QueryString/productid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the canonical link for category & product pages -->
    				
    <!-- start of setting the image link for product pages -->
    			<xsl:param name="image_link">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>images/Product/medium/<xsl:value-of select="/root/QueryString/productid"/>.jpg</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the image link for product pages -->
    				
    <!-- start of setting the product name for product pages -->
    			<xsl:param name="prod_name">
    				<xsl:choose>
    <xsl:when test="boolean(/root/Products/Product/Name)"><xsl:value-of select="/root/Products/Product/Name"/></xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the product name for product pages -->
    				
    				
    <!-- start of setting the product description for product pages (including stripping html tags) -->
    <xsl:param name="ProductDesc" >
    <xsl:value-of select="/root/Products/Product/Description" disable-output-escaping="yes" />
    </xsl:param>        
    	<xsl:variable name="pureText">
                <xsl:call-template name="removeHtmlTags">
                    <xsl:with-param name="html" select="$ProductDesc"/>
                </xsl:call-template>
            </xsl:variable>
    <xsl:variable name="FBDesc" ><xsl:value-of select="substring($pureText, 0, 250)" /></xsl:variable>  
    <!-- end of setting the product description for product pages (including stripping html tags) -->
    
    <!-- start of rel canonical DELETE THIS IF YOU DON'T WANT IT -->	
    <xsl:choose>
    <xsl:when test="$canonical != 0">
    <link rel="canonical" href="{$canonical}" />
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    <!-- end of rel canonical DELETE THIS IF YOU DON'T WANT IT -->
    	
    	
    <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->	
    <xsl:choose>
    <xsl:when test="$image_link != 0">
    <meta property="og:title" content="{$prod_name}"/>
    <meta property="og:type" content="product"/>
    <meta property="og:image" content="{$image_link}"/>
    <meta property="og:url" content="{$canonical}"/>
    <meta property="og:description" content="{$FBDesc}"/>
    <meta property="og:site_name" content="Site Name"/>
    <meta property="fb:admins" content="555221822"/>
    <link rel="image_src" href="{$image_link}" />
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->	
    	
    	
                </xsl:template>
    	    
    	    
                
    <!-- start of template to strip html tags -->	
    <xsl:template name="removeHtmlTags">
        <xsl:param name="html"/>
        <xsl:choose>
          <xsl:when test="contains($html, '&lt;')">
            <xsl:value-of select="substring-before($html, '&lt;')"/>
            <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>	    
    <!-- end of template to strip html tags -->
    	    
            </xsl:stylesheet>
        </PackageTransform>
    </package>


    The xmlpackage is fairly well commented, but please shout if you have problems.



    TTFN

    BFG

  8. #8
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default Wrong image is STILL showing...

    I followed your procedure step-by-step and I am not getting the image of my product... Any thoughts?

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

    Default

    Is this appearing in the source of the page?
    C#/VB.NET Code:
    <meta property="og:image" content="http://www.sitename.co.uk/images/Product/medium/123.jpg" /> 
    Do you have a url I can take a look at?

    TTFN

    BFG

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

    Default

    Important reminder - if you're testing this in another skin before going live with it - bear in mind that facebook won't see anything but the default skin...


    TTFN

    BFG

  11. #11
    campbelt101 is offline Member
    Join Date
    Dec 2010
    Posts
    72

    Default

    Any comments on this... obviously I'm missing something here because I am getting the same thing. It's just printing (!XmlPackage Name="facebook"!) at the top of the page, it's not running the xml package.

    Edit: Ok, I'm running version 9.1.0.1 and I found one issue. You can't start an XML Package the old way, (!XmlPackage Name="facebook"!). I found an article that lead me to using

    Code:
    <asp:Literal ID="lit1" runat="server" Text="<%$ Tokens:Xmlpackage, facebook.xml.config %>" />
    However, this produces nothing in the source code of the page, so something still isn't working.

    Quote Originally Posted by macecase View Post
    Thanks for sharing. I am getting an error.

    The log shows two errors when trying to view a product:

    Code:
    Source:AspDotNetStorefrontCore 
    Message:Error Calling XSLTExtension Function ProductLink: Invalid value specified for ProductID () 
    Stack Trace: 
    at AspDotNetStorefrontCore.InputValidator.ReportError(String ParamName, String ParamValue) 
    at AspDotNetStorefrontCore.InputValidator.ValidateInt(String ParamName, String ParamValue) 
    at AspDotNetStorefrontCore.XSLTExtensionBase.ProductLink(String sProductID, String sSEName, String sIncludeATag)
    and
    Code:
    Message:Error Calling XSLTExtension Function ProductLink: Invalid value specified for ProductID ()
    I am guessing the (!XmlPackage Name="facebook"!) I placed right before the </head> of my template is the cause... because it puts (!XmlPackage Name="facebook"!) on every page in text.... So, I'm guessing that is related.

    Any thoughts?
    Last edited by campbelt101; 05-27-2011 at 09:17 AM.

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

    Default

    Quote Originally Posted by campbelt101 View Post
    Any comments on this... obviously I'm missing something here because I am getting the same thing. It's just printing (!XmlPackage Name="facebook"!) at the top of the page, it's not running the xml package.

    Edit: Ok, I'm running version 9.1.0.1 and I found one issue. You can't start an XML Package the old way, (!XmlPackage Name="facebook"!). I found an article that lead me to using

    Code:
    <asp:Literal ID="lit1" runat="server" Text="<%$ Tokens:Xmlpackage, facebook.xml.config %>" />
    However, this produces nothing in the source code of the page, so something still isn't working.
    Sorry - haven't looked at V9 yet - maybe someone else can chime in here?


    TTFN

    BFG

  13. #13
    gabe is offline Junior Member
    Join Date
    Mar 2009
    Posts
    4

    Default Can't get it working

    Thanks, BFG!

    I followed all the directions and I can't get it to work. I am testing the code with 1 product. I just get redirected to the homepage with the following url:

    http://www.brindleysmusic.com/defaul...owproduct.aspx

    Does anyone have any ideas? I am using version 8. Here is the link to the product:
    http://www.brindleysmusic.com/p-2259...thvocoder.aspx

    Thanks in advance

  14. #14
    donato is offline Senior Member
    Join Date
    Jun 2009
    Posts
    215

    Default

    Well, this is weird... I have change the URLs to point to my site root, however, on some of the products, it still shows sitename.co.ok. Why would that be happening?

  15. #15
    macecase is offline Member
    Join Date
    Feb 2011
    Posts
    44

    Default

    I put
    Code:
    <%--(!XmlPackage Name="facebook.xml.config"!)--%>
    in the header and it processes fine (without writing the literal text at the top of every page like you were experiencing) but I get no output from that xml package (ie no META info in the source of the page)...

    So, it appears like the page loads but doesn't really process the facebook.xml package.

    Does anybody have any thoughts? I really want to get this to work!


    Quote Originally Posted by campbelt101 View Post
    Any comments on this... obviously I'm missing something here because I am getting the same thing. It's just printing (!XmlPackage Name="facebook"!) at the top of the page, it's not running the xml package.

    Edit: Ok, I'm running version 9.1.0.1 and I found one issue. You can't start an XML Package the old way, (!XmlPackage Name="facebook"!). I found an article that lead me to using

    Code:
    <asp:Literal ID="lit1" runat="server" Text="<%$ Tokens:Xmlpackage, facebook.xml.config %>" />
    However, this produces nothing in the source code of the page, so something still isn't working.

  16. #16
    allywidd is offline Junior Member
    Join Date
    Nov 2009
    Location
    UK
    Posts
    13

    Default

    Just what I was looking for. Great stuff. cheers guys. Needed the XML so that I could get a unique image to appear on each product page for the custom built share option I placed on a clients site.

    Works as treat.
    Last edited by allywidd; 07-05-2011 at 02:19 AM.
    Alun Widdowson
    -----------------------
    Premium Stores/AspdotnetStorefront Designer

    http://www.frooition.com

  17. #17
    don.irwin is offline Member
    Join Date
    Apr 2006
    Location
    Phoenix AZ
    Posts
    81

    Thumbs up

    for Multi-Store ver 9+ to call an xml package in a template or aspx page, use the following...

    Code:
    <aspdnsf:XmlPackage ID="carouselpackage" runat="server" PackageName="facebook.xml.config" />
    and make sure you register the aspdnsf tag prefix:

    Code:
    <%@ Register TagPrefix="aspdnsf" TagName="XmlPackage" Src="~/Controls/XmlPackageControl.ascx" %>

  18. #18
    don.irwin is offline Member
    Join Date
    Apr 2006
    Location
    Phoenix AZ
    Posts
    81

    Thumbs up

    here is a simplified package for MS 9+ that uses:
    • SEDescription (no need to strip html)
    • /root/System/StoreUrl and /root/System/PageName for the canonical URL (no editing and/or guessing
    • aspdnsf:ProductImageUrl to get the link to the image (no assumptions/guessing)


    Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="BFGs Facebook / rel canonical package" debug="false" includeentityhelper="false" allowengine="true">
    
      <query name="Products" rowElementName="Product">
        <sql>
          <![CDATA[
                    SELECT ProductID, Name, SEDescription, ImageFileNameOverride, SKU FROM Product WHERE ProductID = @ProductID
                ]]>
        </sql>
        <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
      </query>
    
      <PackageTransform>
        <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="xml" omit-xml-declaration="yes" />
    
          <xsl:template match="/">
    
            <!-- start of setting the canonical link for category & product pages -->
            <xsl:param name="canonical" select="concat(/root/System/StoreUrl, /root/System/PageName)" />
    
            <!-- end of setting the canonical link for category & product pages -->
    
            <!-- start of setting the image link for product pages -->
            <xsl:param name="image_link">
              <xsl:choose>
                <xsl:when test="boolean(/root/Products/Product/ProductID)">
                  <xsl:value-of select="aspdnsf:ProductImageUrl(/root/Products/Product/ProductID, /root/Products/Product/ImageFileNameOverride, /root/Products/Product/SKU, 'medium', 'true')" />
                </xsl:when>
                <xsl:otherwise>0</xsl:otherwise>
              </xsl:choose>
            </xsl:param>
            <!-- end of setting the image link for product pages -->
    
            <!-- start of setting the product name for product pages -->
            <xsl:param name="prod_name">
              <xsl:choose>
                <xsl:when test="boolean(/root/Products/Product/ProductID)">
                  <xsl:value-of select="/root/Products/Product/Name"/>
                </xsl:when>
                <xsl:otherwise>0</xsl:otherwise>
              </xsl:choose>
            </xsl:param>
            <!-- end of setting the product name for product pages -->
    
    
            <!-- use SEDescription - no HTML -->
            <xsl:variable name="FBDesc" select="/root/Products/Product/SEDescription" />
            <!-- end of setting the product description for product pages (including stripping html tags) -->
    
            <!-- start of rel canonical DELETE THIS IF YOU DON'T WANT IT -->
            <xsl:choose>
              <xsl:when test="$canonical != 0">
                <link rel="canonical" href="{$canonical}" />
              </xsl:when>
              <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
            <!-- end of rel canonical DELETE THIS IF YOU DON'T WANT IT -->
    
    
            <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->
            <xsl:choose>
              <xsl:when test="$image_link != 0">
                <meta property="og:title" content="{$prod_name}"/>
                <meta property="og:type" content="product"/>
                <meta property="og:image" content="{$image_link}"/>
                <meta property="og:url" content="{$canonical}"/>
                <meta property="og:description" content="{$FBDesc}"/>
                <meta property="og:site_name" content="Site Name"/>
                <meta property="fb:admins" content="555221822"/>
                <link rel="image_src" href="{$image_link}" />
              </xsl:when>
              <xsl:otherwise></xsl:otherwise>
            </xsl:choose>
            <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->
    
          </xsl:template>
        </xsl:stylesheet>
      </PackageTransform>
    </package>
    Last edited by don.irwin; 08-11-2011 at 12:27 PM.

  19. #19
    butcher is offline Junior Member
    Join Date
    Apr 2009
    Posts
    19

    Thumbs up Thank you BFG

    Thanks again to BFG for sharing his knowledge and work with the community! This isn't the first time he made my site better. This fired for me on the first try...great instructions! Thanks to all the others who have shared or improved on this post too.

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

    Default

    Careful - You'll make me blush!


    TTFN

    BFG

  21. #21
    Nagesh_Vitta is offline Member
    Join Date
    Aug 2009
    Posts
    58

    Default Product image Image is not listing

    I have followed the instructions but my og tags has additional data. any clue? like &#xD;&#xA;


    <!-- start of BFG Facebook XML Package -->
    <link rel="canonical" href="http://www.mysite.com/p-26387-soaked-in-luxury-batwing-jumper.aspx&#xD;&#xA; " /><meta property="og:title" content="Soaked In Luxury Batwing Jumper" /><meta property="og:type" content="product" /><meta property="og:image" content="http://www.mysite.com/images/Product/medium/26387.jpg&#xD;&#xA; " /><meta property="og:url" content="http://www.mysite.com/p-26387-soaked-in-luxury-batwing-jumper.aspx&#xD;&#xA; " /><meta property="og:description" content="A chic update on winter's quintessential cable, this Soaked in Luxury jumper is perfect for smart/casual styling, boasting directional batwing sleeves and a unique honeycomb knit panel.Features: Deep ribbed waistband, honeycomb knit panel across che" /><meta property="og:site_name" content="mysite" /><meta property="fb:admins" content="218243110149" /><link rel="image_src" href="http://www.mysite.com/images/Product/medium/26387.jpg&#xD;&#xA; " />
    <!-- end of BFG Facebook XML Package -->

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

    Default

    The &#xD;&#xA; are carriage returns and line spaces either within your XML or your XSLT. Make sure the xml is like

    HTML Code:
    <Value>3</Value>
    Rather than

    HTML Code:
    <Value>
        3
    </Value>


    TTFN

    BFG

  23. #23
    Nagesh_Vitta is offline Member
    Join Date
    Aug 2009
    Posts
    58

    Default Image issue

    Thanks for quick response. I fixed that but it's sending different image to fb.
    We used Men image for different purpose but everytime I like, its sending Men image to fb not product image.


    http://www.facebook.com/profile.php?id=100001964692066

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

    Default

    I don't think that you followed the instructions exactly?
    I'm looking at (what I guess is) your product page here, & I don't see the tags appearing in the source code - if I can't see them, then facebook can't see them...


    TTFN

    BFG

  25. #25
    Nagesh_Vitta is offline Member
    Join Date
    Aug 2009
    Posts
    58

    Default og tags

    Hi,

    Now you can see the og tags for all products www.joythestore.com but still its taking different image.
    We used men.jpg and women.jpg for different purpose but fb is looking only these 2 images.

    any clue?

    Regards
    Nagesh
    Last edited by Nagesh_Vitta; 11-13-2011 at 09:58 PM.

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

    Default

    Ahh I see.

    The product image for that is actually named WWKNSW130010NUD.jp rather then 26387.jpg - I guess you're using imagenameoverride?

    If so - you'll need to tweak the xmlpackage to allow for that.


    TTFN

    BFG

  27. #27
    Nagesh_Vitta is offline Member
    Join Date
    Aug 2009
    Posts
    58

    Default image issue

    I have done that but still same issue. We have used sku code for images.

    Now og tags having correct values but no luck still iam getting the different image.

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

    Default

    It might be getting confused by the addthis script - which also provides facebook functionality.

    It might be getting confused by the presence of 2 x fb:admins tags.

    You can see that facebook have some issues with the tags here.


    TTFN

    BFG

  29. #29
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default Am getting this error

    Any ideas ..Thank you

    XmlPackage Exception: Exception=Last Trace Point=[]. An error occurred during a call to extension function 'ProductLink'. See InnerException for a complete description of the error.

    Error Calling XSLTExtension Function ProductLink: Invalid value specified for ProductID ()


    System.ArgumentException: Last Trace Point=[]. An error occurred during a call to extension function 'ProductLink'. See InnerException for a complete description of the error.

    Error Calling XSLTExtension Function ProductLink: Invalid value specified for ProductID ()

    at AspDotNetStorefrontCore.XmlPackage2.TransformStrin g() at AspDotNetStorefrontCore.AppLogic.RunXmlPackage(Xml Package2 p, Parser UseParser, Customer ThisCustomer, Int32 SkinID, Boolean ReplaceTokens, Boolean WriteExceptionMessage)
    Gordon

    8.1.1

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

    Default

    Can you post your xmlpackage?


    TTFN

    BFG

  31. #31
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    I am testing on the simple product XML
    Hope its ok to post it here.
    HTML Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="Simple Product" debug="false" includeentityhelper="true">
    
    	<!-- ###################################################################################################### -->
    	<!-- Copyright AspDotNetStorefront.com, 1995-2009.  All Rights Reserved.					                -->
    	<!-- http://www.aspdotnetstorefront.com														                -->
    	<!-- For details on this license please visit  the product homepage at the URL above.		                -->
    	<!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
    	<!--                                                                                                        -->
    	<!-- ###################################################################################################### -->
    
        <query name="Products" rowElementName="Product" runif="showproduct">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 1, 0, @affiliateID
                ]]>
            </sql>
            <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
            <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
            <queryparam paramname="@affiliateID"     paramtype="system"  requestparamname="AffiliateID"     sqlDataType="int" defvalue="0"  validationpattern="" />
        </query>
    
    
        <query name="Products" rowElementName="Product" runif="edit">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
                ]]>
            </sql>
            <queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
            <queryparam paramname="@CustomerLevelID"   paramtype="system"  requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
        </query>
    
        <PackageTransform>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf" xmlns:fb="http://www.facebook.com/2008/fbml">
    
                <xsl:output method="html" omit-xml-declaration="yes" />
    			<xsl:param name="pLink" select="aspdnsf:ProductLink(ProductID, SEName, 0)" />
    			<xsl:param name="LocaleSetting" select="/root/Runtime/LocaleSetting" />
                <xsl:param name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />
                <xsl:param name="XmlPackageName" select="/root/System/XmlPackageName" />
    			
    
    
                <xsl:param name="SecID">
                    <xsl:choose>
                        <xsl:when test="count(/root/QueryString/sectionid) &gt; 0"><xsl:value-of select="/root/QueryString/sectionid" /></xsl:when>
                    	<xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
    			
                </xsl:param>
                
                
                <xsl:param name="CatID">
                    <xsl:choose>
                    	<xsl:when test="count(/root/QueryString/categoryid) &gt; 0"><xsl:value-of select="/root/QueryString/categoryid" /></xsl:when>
                    	<xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:param>
    
                <xsl:template match="/">
                    <xsl:comment>Copyright 1995-2009 AspDotNetStorefront.com</xsl:comment>
                    <xsl:choose>
                        <xsl:when test="count(root/Products/Product) &gt; 1">
                            <xsl:for-each select="/root/Products/Product[position()=1]">
                                <xsl:call-template name="MultiVariant"/>
                            </xsl:for-each>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:apply-templates select="/root/Products/Product" />
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:template>
    
    
            <!-- this could obviously be expanded to properly handle multi-variant products -->
                <xsl:template name="MultiVariant">
    
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                    <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
                    <xsl:param name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:param>
                    <xsl:param name="AltText">
                        <xsl:choose>
                            <xsl:when test="$pSEAltText=''"><xsl:value-of select="$pName" /></xsl:when>
                            <xsl:otherwise><xsl:value-of select="$pSEAltText" /></xsl:otherwise>
                        </xsl:choose>
                    </xsl:param>
    
    
    
                    <table border="0" width="100%" cellpadding="4" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                                <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 0, $AltText)" disable-output-escaping="yes" />
                            </td>
                            <td align="left" valign="top" width="100%">
                                <div>
    							
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="100%" align="left" valign="middle">
                                                <span class="ProductNameText">
                                                    <xsl:value-of select="$pName" disable-output-escaping="yes" />
    												
                                                </span>
                                            </td>
                                            <td align="right" valign="Middle">
                                                <xsl:if test="boolean(/root/Runtime/showproduct)">
                                                <nobr>
                                                    <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                </nobr>
                                                </xsl:if>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div>
                                    <br />
                                </div>
                                <div>
                                    <b>
                                        <font color="red">
                                            Display of multi-variant products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                                        </font>
                                    </b>
                                </div>
                            </td>
                        </tr>
                    </table>
    
                </xsl:template>
    
    
                <xsl:template match="Product">
    
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                    <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
                    <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
                    <xsl:param name="AltText">
                        <xsl:choose>
                            <xsl:when test="aspdnsf:GetMLValue(SEAltText)=''"><xsl:value-of select="aspdnsf:GetMLValue(Name)" /></xsl:when>
                            <xsl:otherwise><xsl:value-of select="aspdnsf:GetMLValue(SEAltText)" /></xsl:otherwise>
                        </xsl:choose>
                    </xsl:param>
    
                    <xsl:choose>
                        <xsl:when test="IsAKit=1">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr>
                                    <td align="left" valign="top">                                    
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText"><xsl:value-of select="$pName" disable-output-escaping="yes" /></span>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div><br /></div>
                                        <div><b><font color="red">Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" /></font></b></div>
                                    </td>
                                </tr>
                            </table>
                        </xsl:when>
                        <xsl:when test="IsAPack=1">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr><td align="left" valign="top">
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText"><xsl:value-of select="$pName" disable-output-escaping="yes" /></span>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div><br /></div>
                                        <div><b><font color="red">Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" /></font></b></div>
                                    </td>
                                </tr>
                            </table>
    						
                        </xsl:when>
                        <xsl:otherwise>
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr><td align="left" valign="top">
    							
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                    </td><div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: '', status: true, cookie: true, xfbml: true});
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol + '//connect.facebook.net/en_GB/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    <div style="width:450px">
    <fb:like href="http://australia.continentalclothing.jp/{$pLink}" show_faces="false" width="450" font="verdana"></fb:like><br />
    </div>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText"><xsl:value-of select="$pName" disable-output-escaping="yes" /></span>
                                                        <br/>
                                                        <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes"/>
                                                        <br/>
                                                        <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
    
                                                      <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled')='true'">
                                                        <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
                                                          <p>
                                                            <a target="_blank">
                                                              <xsl:attribute name="href">
                                                                <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreURL')"/>
                                                              </xsl:attribute>
                                                              <img>
                                                                <xsl:attribute name="src">
                                                                  <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL')"/>
                                                                </xsl:attribute>
                                                              </img>
                                                            </a>
                                                          </p>
                                                        </xsl:if>
                                                      </xsl:if>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div><br /></div>
                                        <div><xsl:value-of select="$pDescription" disable-output-escaping="yes"/></div>
                                        <div><br /></div>
    									<xsl:choose>
    										<!-- 
                                              Showing of inventory table also goes through the rules of DisplayOutOfStock appconfig if enabled..
                                            -->
    										<xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')='true'">
    											<div>
    												<xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
    											</div>
    										</xsl:when>
    										<xsl:otherwise>
    											<xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProducts') = 'true'">
    												<div>
    														<xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
    												</div>
    											</xsl:if>
    										</xsl:otherwise>
    									</xsl:choose>
    				                    <xsl:if test="number(CustomerEntersPrice)=0">
                                            <div>
                                                <span>
                                                    <xsl:attribute name="id">VariantPrice_<xsl:value-of select="VariantID"/></xsl:attribute>
                                                    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
                                                </span>
                                            </div>
                                            <br />
                    				    </xsl:if>
                                        <div>
                                            <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductID)" disable-output-escaping="yes"/><br/>
                                            <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1)" disable-output-escaping="yes"/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <xsl:if test="boolean(/root/Runtime/showproduct)">
                            <xsl:value-of select="aspdnsf:RelatedProducts(ProductID)" disable-output-escaping="yes"/>
                            <xsl:value-of select="aspdnsf:RecentlyViewed(ProductID)" disable-output-escaping="yes"/>
                            <xsl:value-of select="aspdnsf:ShowUpsellProducts(ProductID)" disable-output-escaping="yes"/>
    							          <xsl:value-of select="aspdnsf:AlsoBought(ProductID, VariantID)" disable-output-escaping="yes"/>
    							          <xsl:value-of select="aspdnsf:ProductSpecs(ProductID, 1, SpecsInline, SpecCall, 400)" disable-output-escaping="yes"/>
                            <xsl:value-of select="aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1)" disable-output-escaping="yes"/>
                            </xsl:if>
                        </xsl:otherwise>
                    </xsl:choose>
    
                </xsl:template>
    
            </xsl:stylesheet>
        </PackageTransform>
    </package>
    http://australia.continentalclothing...d-t-shirt.aspx

    Thank you
    Last edited by tito; 01-16-2012 at 03:52 AM.
    Gordon

    8.1.1

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

    Default

    Here you go :-


    Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="Simple Product" debug="false" includeentityhelper="true">
    
    	<!-- ###################################################################################################### -->
    	<!-- Copyright AspDotNetStorefront.com, 1995-2009.  All Rights Reserved.					                -->
    	<!-- http://www.aspdotnetstorefront.com														                -->
    	<!-- For details on this license please visit  the product homepage at the URL above.		                -->
    	<!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
    	<!--                                                                                                        -->
    	<!-- ###################################################################################################### -->
    
        <query name="Products" rowElementName="Product" runif="showproduct">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 1, 0, @affiliateID
                ]]>
            </sql>
            <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
            <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
            <queryparam paramname="@affiliateID"     paramtype="system"  requestparamname="AffiliateID"     sqlDataType="int" defvalue="0"  validationpattern="" />
        </query>
    
    
        <query name="Products" rowElementName="Product" runif="edit">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
                ]]>
            </sql>
            <queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
            <queryparam paramname="@CustomerLevelID"   paramtype="system"  requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
        </query>
    
        <PackageTransform>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf" xmlns:fb="http://www.facebook.com/2008/fbml">
    
                <xsl:output method="html" omit-xml-declaration="yes" />
    			
    			<xsl:param name="LocaleSetting" select="/root/Runtime/LocaleSetting" />
                <xsl:param name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />
                <xsl:param name="XmlPackageName" select="/root/System/XmlPackageName" />
    			
    
    
                <xsl:param name="SecID">
                    <xsl:choose>
                        <xsl:when test="count(/root/QueryString/sectionid) &gt; 0"><xsl:value-of select="/root/QueryString/sectionid" /></xsl:when>
                    	<xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
    			
                </xsl:param>
                
                
                <xsl:param name="CatID">
                    <xsl:choose>
                    	<xsl:when test="count(/root/QueryString/categoryid) &gt; 0"><xsl:value-of select="/root/QueryString/categoryid" /></xsl:when>
                    	<xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:param>
    
                <xsl:template match="/">
                    <xsl:comment>Copyright 1995-2009 AspDotNetStorefront.com</xsl:comment>
                    <xsl:choose>
                        <xsl:when test="count(root/Products/Product) &gt; 1">
                            <xsl:for-each select="/root/Products/Product[position()=1]">
                                <xsl:call-template name="MultiVariant"/>
                            </xsl:for-each>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:apply-templates select="/root/Products/Product" />
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:template>
    
    
            <!-- this could obviously be expanded to properly handle multi-variant products -->
                <xsl:template name="MultiVariant">
    
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                    <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
                    <xsl:param name="pSEAltText" select="aspdnsf:GetMLValue(SEAltText)"></xsl:param>
                    <xsl:param name="AltText">
                        <xsl:choose>
                            <xsl:when test="$pSEAltText=''"><xsl:value-of select="$pName" /></xsl:when>
                            <xsl:otherwise><xsl:value-of select="$pSEAltText" /></xsl:otherwise>
                        </xsl:choose>
                    </xsl:param>
    
    
    
                    <table border="0" width="100%" cellpadding="4" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                                <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 0, $AltText)" disable-output-escaping="yes" />
                            </td>
                            <td align="left" valign="top" width="100%">
                                <div>
    							
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="100%" align="left" valign="middle">
                                                <span class="ProductNameText">
                                                    <xsl:value-of select="$pName" disable-output-escaping="yes" />
    												
                                                </span>
                                            </td>
                                            <td align="right" valign="Middle">
                                                <xsl:if test="boolean(/root/Runtime/showproduct)">
                                                <nobr>
                                                    <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                </nobr>
                                                </xsl:if>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div>
                                    <br />
                                </div>
                                <div>
                                    <b>
                                        <font color="red">
                                            Display of multi-variant products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                                        </font>
                                    </b>
                                </div>
                            </td>
                        </tr>
                    </table>
    
                </xsl:template>
    
    
                <xsl:template match="Product">
    				<xsl:param name="pLink" select="aspdnsf:ProductLink(ProductID, SEName, 0)" />
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                    <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
                    <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
                    <xsl:param name="AltText">
                        <xsl:choose>
                            <xsl:when test="aspdnsf:GetMLValue(SEAltText)=''"><xsl:value-of select="aspdnsf:GetMLValue(Name)" /></xsl:when>
                            <xsl:otherwise><xsl:value-of select="aspdnsf:GetMLValue(SEAltText)" /></xsl:otherwise>
                        </xsl:choose>
                    </xsl:param>
    
                    <xsl:choose>
                        <xsl:when test="IsAKit=1">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr>
                                    <td align="left" valign="top">                                    
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText"><xsl:value-of select="$pName" disable-output-escaping="yes" /></span>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div><br /></div>
                                        <div><b><font color="red">Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" /></font></b></div>
                                    </td>
                                </tr>
                            </table>
                        </xsl:when>
                        <xsl:when test="IsAPack=1">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr><td align="left" valign="top">
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText"><xsl:value-of select="$pName" disable-output-escaping="yes" /></span>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div><br /></div>
                                        <div><b><font color="red">Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" /></font></b></div>
                                    </td>
                                </tr>
                            </table>
    						
                        </xsl:when>
                        <xsl:otherwise>
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr><td align="left" valign="top">
    							
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1, $AltText)" disable-output-escaping="yes"/>
                                    </td><div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: '', status: true, cookie: true, xfbml: true});
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol + '//connect.facebook.net/en_GB/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>
    <div style="width:450px">
    <fb:like href="http://australia.continentalclothing.jp/{$pLink}" show_faces="false" width="450" font="verdana"></fb:like><br />
    </div>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText"><xsl:value-of select="$pName" disable-output-escaping="yes" /></span>
                                                        <br/>
                                                        <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes"/>
                                                        <br/>
                                                        <xsl:value-of select="aspdnsf:ProductSpecsLink(ProductID, SpecsInline, SpecTitle, SKU, SpecCall)" disable-output-escaping="yes" />
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
    
                                                      <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled')='true'">
                                                        <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
                                                          <p>
                                                            <a target="_blank">
                                                              <xsl:attribute name="href">
                                                                <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreURL')"/>
                                                              </xsl:attribute>
                                                              <img>
                                                                <xsl:attribute name="src">
                                                                  <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL')"/>
                                                                </xsl:attribute>
                                                              </img>
                                                            </a>
                                                          </p>
                                                        </xsl:if>
                                                      </xsl:if>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div><br /></div>
                                        <div><xsl:value-of select="$pDescription" disable-output-escaping="yes"/></div>
                                        <div><br /></div>
    									<xsl:choose>
    										<!-- 
                                              Showing of inventory table also goes through the rules of DisplayOutOfStock appconfig if enabled..
                                            -->
    										<xsl:when test="aspdnsf:AppConfigBool('ShowInventoryTable')='true'">
    											<div>
    												<xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
    											</div>
    										</xsl:when>
    										<xsl:otherwise>
    											<xsl:if test="aspdnsf:AppConfigBool('DisplayOutOfStockProducts') = 'true'">
    												<div>
    														<xsl:value-of select="aspdnsf:DisplayProductStockHint(ProductID, VariantID, 'Product')" disable-output-escaping="yes" />
    												</div>
    											</xsl:if>
    										</xsl:otherwise>
    									</xsl:choose>
    				                    <xsl:if test="number(CustomerEntersPrice)=0">
                                            <div>
                                                <span>
                                                    <xsl:attribute name="id">VariantPrice_<xsl:value-of select="VariantID"/></xsl:attribute>
                                                    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
                                                </span>
                                            </div>
                                            <br />
                    				    </xsl:if>
                                        <div>
                                            <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductID)" disable-output-escaping="yes"/><br/>
                                            <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1)" disable-output-escaping="yes"/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <xsl:if test="boolean(/root/Runtime/showproduct)">
                            <xsl:value-of select="aspdnsf:RelatedProducts(ProductID)" disable-output-escaping="yes"/>
                            <xsl:value-of select="aspdnsf:RecentlyViewed(ProductID)" disable-output-escaping="yes"/>
                            <xsl:value-of select="aspdnsf:ShowUpsellProducts(ProductID)" disable-output-escaping="yes"/>
    							          <xsl:value-of select="aspdnsf:AlsoBought(ProductID, VariantID)" disable-output-escaping="yes"/>
    							          <xsl:value-of select="aspdnsf:ProductSpecs(ProductID, 1, SpecsInline, SpecCall, 400)" disable-output-escaping="yes"/>
                            <xsl:value-of select="aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1)" disable-output-escaping="yes"/>
                            </xsl:if>
                        </xsl:otherwise>
                    </xsl:choose>
    
                </xsl:template>
    
            </xsl:stylesheet>
        </PackageTransform>
    </package>

    TTFN

    BFG

  33. #33
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Smile WAW thats amazing

    Thank you very much BFG9000
    VERY KIND OF YOU..

    CHEERS

    May i ask what was the change/problem..
    Am trying to compare the old with the new but can't find anything...
    Last edited by tito; 01-16-2012 at 06:27 PM.
    Gordon

    8.1.1

  34. #34
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    Just figured it out .. seems like it was the location of

    <xslaram name="pLink" select="aspdnsf:ProductLink(ProductID, SEName, 0)" />

    that made error ..
    THANK YOU
    Gordon

    8.1.1

  35. #35
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    I am using Imagenameoveride
    example http://australia.continentalclothing...edium/EP40.jpg

    what code do i change in the XML
    Is this the code i need to edit ..

    HTML Code:
    !-- start of setting the image link for product pages -->
    			<xsl:param name="image_link">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>images/Product/medium/<xsl:value-of select="/root/QueryString/productid"/>.jpg</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the image link for product pages -->

    Quote Originally Posted by BFG 9000 View Post
    Ahh I see.

    The product image for that is actually named WWKNSW130010NUD.jp rather then 26387.jpg - I guess you're using imagenameoverride?

    If so - you'll need to tweak the xmlpackage to allow for that.


    TTFN

    BFG
    Gordon

    8.1.1

  36. #36
    butcher is offline Junior Member
    Join Date
    Apr 2009
    Posts
    19

    Default

    I thought I had this all working, but apparently not…

    When I click the like button and start entering a comment I notice a red message next to the button that reads ‘Error’. When I click on it I get redirected to FB and receive the message
    ‘There was an error retrieving data for http://www.cubookstore.com/p-4853-1-...inger.aspx.’

    As far as I can tell it’s all working accept the image does not get displayed in the FB feed. I did get the image to work when I first tried BFG’s instructions, but can’t get it back. I have been running my changes through here http://developers.facebook.com/tools/debug but the errors don’t make sense to me. It’s saying there is no og:url, og:type, or og:title, but I can see them all in the page source. It also says it can’t scrape the page.

    The one difference I notice is when I change my link from http:// to https:// in the debugger I get a totally different message but the image still does not appear. It also seems like I get different response depending if the product has been liked or not.

    any help or suggestions would be greatly appreciated.

    Thank you,
    Eric
    7.1.0.0

    Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="Simple Product" debug="false" includeentityhelper="true">
    
        <!-- ###################################################################################################### -->
        <!-- Copyright AspDotNetStorefront.com, 1995-2008.  All Rights Reserved.					                -->
        <!-- http://www.aspdotnetstorefront.com														                -->
        <!-- For details on this license please visit  the product homepage at the URL above.		                -->
        <!-- THE ABOVE NOTICE MUST REMAIN INTACT.                                                                   -->
        <!--                                                                                                        -->
        <!-- ###################################################################################################### -->
    
        <query name="Products" rowElementName="Product" runif="showproduct">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_ProductInfo @ProductID, @CustomerLevelID, 1, 0, @affiliateID
                ]]>
            </sql>
            <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
            <queryparam paramname="@CustomerLevelID" paramtype="runtime" requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
            <queryparam paramname="@affiliateID"     paramtype="system"  requestparamname="AffiliateID"     sqlDataType="int" defvalue="0"  validationpattern="" />
        </query>
    
    
        <query name="Products" rowElementName="Product" runif="edit">
            <sql>
                <![CDATA[
                    exec dbo.aspdnsf_EditOrderProduct @ShoppingCartRecID, @CustomerLevelID
                ]]>
            </sql>
            <queryparam paramname="@ShoppingCartRecID" paramtype="request" requestparamname="CartRecID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
            <queryparam paramname="@CustomerLevelID"   paramtype="system"  requestparamname="CustomerLevelID" sqlDataType="int" defvalue="0"  validationpattern="" />
        </query>
    
        <PackageTransform>
            <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" exclude-result-prefixes="aspdnsf" xmlns:fb="http://www.facebook.com/2008/fbml">
                <xsl:output method="html" omit-xml-declaration="yes" />
    
                <xsl:param name="LocaleSetting" select="/root/Runtime/LocaleSetting" />
                <xsl:param name="WebConfigLocaleSetting" select="/root/Runtime/WebConfigLocaleSetting" />
                <xsl:param name="XmlPackageName" select="/root/System/XmlPackageName" />
                <xsl:param name="SecID">
                    <xsl:choose>
                        <xsl:when test="count(/root/QueryString/sectionid) &gt; 0">
                            <xsl:value-of select="/root/QueryString/sectionid" />
                        </xsl:when>
                        <xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:param>
    
    
                <xsl:param name="CatID">
                    <xsl:choose>
                        <xsl:when test="count(/root/QueryString/categoryid) &gt; 0">
                            <xsl:value-of select="/root/QueryString/categoryid" />
                        </xsl:when>
                        <xsl:otherwise>0</xsl:otherwise>
                    </xsl:choose>
                </xsl:param>
    
                <xsl:template match="/">
                    <xsl:comment>Copyright 1995-2008 AspDotNetStorefront.com</xsl:comment>
                    <xsl:choose>
                        <xsl:when test="count(root/Products/Product) &gt; 1">
                            <xsl:for-each select="/root/Products/Product[position()=1]">
                                <xsl:call-template name="MultiVariant"/>
                            </xsl:for-each>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:apply-templates select="/root/Products/Product" />
                        </xsl:otherwise>
                    </xsl:choose>
                </xsl:template>
    
    
                <!-- this could obviously be expanded to properly handle multi-variant products -->
                <xsl:template name="MultiVariant">
    
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                    <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
    
    
    
                    <table border="0" width="100%" cellpadding="4" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                                <xsl:value-of select="aspdnsf:LookupImage(ProductID, 'product', 'medium', 1)" disable-output-escaping="yes"/>
                            </td>
                            <td align="left" valign="top" width="100%">
                                <div>
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td width="100%" align="left" valign="middle">
                                                <span class="ProductNameText">
                                                    <xsl:value-of select="$pName" disable-output-escaping="yes" />
                                                </span>
                                            </td>
                                            <td align="right" valign="Middle">
                                                <xsl:if test="boolean(/root/Runtime/showproduct)">
                                                    <nobr>
                                                        <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                    </nobr>
                                                </xsl:if>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div>
                                    <br />
                                </div>
                                <div>
                                    <b>
                                        <font color="red">
                                            Display of multi-variant products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                                        </font>
                                    </b>
                                </div>
                            </td>
                        </tr>
                    </table>
    
                </xsl:template>
    
    
                <xsl:template match="Product">
                    <!--FB like & comments link start-->
                    <xsl:param name="pLink" select="aspdnsf:ProductLink(ProductID, SEName, 0)"></xsl:param>
                    <!--FB like & comments link end-->
                    <xsl:param name="pName" select="aspdnsf:GetMLValue(Name)"></xsl:param>
                    <xsl:param name="pDescription" select="aspdnsf:GetMLValue(Description)"></xsl:param>
                    <xsl:param name="pSalesPromptName" select="aspdnsf:GetMLValue(SalesPromptName)"></xsl:param>
    
                    <xsl:choose>
                        <xsl:when test="IsAKit=1">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr>
                                    <td align="left" valign="top">
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText">
                                                            <xsl:value-of select="$pName" disable-output-escaping="yes" />
                                                        </span>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div>
                                            <br />
                                        </div>
                                        <div>
                                            <b>
                                                <font color="red">
                                                    Display of Kit Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                                                </font>
                                            </b>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </xsl:when>
                        <xsl:when test="IsAPack=1">
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr>
                                    <td align="left" valign="top">
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="100%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <span class="ProductNameText">
                                                            <xsl:value-of select="$pName" disable-output-escaping="yes" />
                                                        </span>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div>
                                            <br />
                                        </div>
                                        <div>
                                            <b>
                                                <font color="red">
                                                    Display of Pack Products is not supported by this XmlPackage.<br /><br />XmlPackage=<xsl:value-of select="$XmlPackageName" />
                                                </font>
                                            </b>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </xsl:when>
    
    
    
    
                        <xsl:otherwise>
                            <table border="0" width="100%" cellpadding="4" cellspacing="0">
                                <tr>
                                    <td align="right" valign="top" width="50%">
                                        <xsl:value-of select="aspdnsf:LookupProductImage(ProductID, ImageFilenameOverride, SKU, 'medium', 1)" disable-output-escaping="yes"/>
                                    </td>
                                    <td align="left" valign="top" width="50%">
                                        <div>
                                            <table width="100%" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td width="100%" align="left" valign="middle">
                                                        <br/>
                                                        <br/>
                                                        <span class="ProductNameText">
                                                            <xsl:value-of select="$pName" disable-output-escaping="yes" />
                                                        </span>
                                                        <br/>
                                                        <span>
                                                            SKU# <xsl:value-of select="SKU" disable-output-escaping="yes" />
                                                        </span>
                                                        <br/>
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, $CatID, $SecID)" disable-output-escaping="yes" />
                                                            <xsl:value-of select="aspdnsf:EmailProductToFriend(ProductID, $CatID)" disable-output-escaping="yes"/>
                                                        </nobr>
                                                    </td>
                                                    <td align="right" valign="Middle">
                                                        <nobr>
                                                            <xsl:value-of select="aspdnsf:ProductNavLinks(ProductID, /root/Runtime/EntityID, /root/Runtime/EntityName, /root/EntityHelpers/*[name()=/root/Runtime/EntityName]/descendant::Entity[EntityID=/root/Runtime/EntityID]/SEName, 0, 1, 1)" disable-output-escaping="yes" />
                                                        </nobr>
    
                                                        <xsl:if test="aspdnsf:AppConfigBool('PayPal.Promo.Enabled')='true'">
                                                            <xsl:if test="Price &lt;= aspdnsf:AppConfig('PayPal.Promo.CartMaximum') and Price &gt;= aspdnsf:AppConfig('PayPal.Promo.CartMinimum')">
                                                                <p>
                                                                    <a target="_blank">
                                                                        <xsl:attribute name="href">
                                                                            <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.LearnMoreURL')"/>
                                                                        </xsl:attribute>
                                                                        <img>
                                                                            <xsl:attribute name="src">
                                                                                <xsl:value-of select="aspdnsf:AppConfig('PayPal.Promo.BannerURL')"/>
                                                                            </xsl:attribute>
                                                                        </img>
                                                                    </a>
                                                                </p>
                                                            </xsl:if>
                                                        </xsl:if>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        <div>
                                            <br />
                                        </div>
                                        <xsl:if test="aspdnsf:AppConfigBool('ShowInventoryTable')='true'">
                                            <div>
                                                <xsl:value-of select="aspdnsf:ShowInventoryTable(ProductID, VariantID)" disable-output-escaping="yes" />
                                            </div>
                                        </xsl:if>
                                        <xsl:if test="number(CustomerEntersPrice)=0">
                                            <div id="price">
                                                <span>
                                                    <xsl:attribute name="id">
                                                        VariantPrice_<xsl:value-of select="VariantID"/>
                                                    </xsl:attribute>
                                                    <xsl:value-of select="aspdnsf:GetVariantPrice(VariantID, number(HidePriceUntilCart), Price, SalePrice, ExtendedPrice, Points, $pSalesPromptName, TaxClassID)" disable-output-escaping="yes" />
                                                </span>
                                            </div>
                                            <br />
                                        </xsl:if>
                                        <div>
                                            <xsl:value-of select="aspdnsf:ShowQuantityDiscountTable(ProductID)" disable-output-escaping="yes"/>
                                            <br/>
                                            <xsl:value-of select="aspdnsf:AddtoCartForm(ProductID, VariantID, 1)" disable-output-escaping="yes"/>
                                        </div>
    
                                        <!--facebook like start-->
                                        <div id="fb-root"></div>
                                        <script>
                                            window.fbAsyncInit = function() {
                                            FB.init({appId: '141703142604248',status: true, cookie: true,
                                            xfbml: true});
                                            };
                                            (function() {
                                            var e = document.createElement('script'); e.async = true;
                                            e.src = document.location.protocol +
                                            '//connect.facebook.net/en_US/all.js';
                                            document.getElementById('fb-root').appendChild(e);
                                            }());
                                        </script>
                                        <div style="padding:25px 0px 10px 0px;">
                                            <fb:like href="http://www.cubookstore.com/{$pLink}" show_faces="false" width="100%" font="verdana"></fb:like>
                                        </div>
                                        <!--facebook like end-->
                                    </td>
                                </tr>
                            </table>
    
    
                            <br/>
                            <table id="ProductDescription" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <div class="contentHeaders">FEATURES</div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="description">
                                            <br />
                                            <xsl:value-of select="$pDescription" disable-output-escaping="yes"/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <xsl:if test="boolean(/root/Runtime/showproduct)">
                                <xsl:value-of select="aspdnsf:RelatedProducts(ProductID)" disable-output-escaping="yes"/>
                                <xsl:value-of select="aspdnsf:ShowUpsellProducts(ProductID)" disable-output-escaping="yes"/>
                                <xsl:value-of select="aspdnsf:ProductSpecs(ProductID, 1, SpecsInline, SpecCall, 400)" disable-output-escaping="yes"/>
                                <!--  START REMOVES RATING IMAGES BUT NOT TEXT AND STARS-->
                                <br/>
                                <script>
                                    $(document).ready(function(){
                                    $("#rating-hider table table table:first").remove();
                                    });
                                </script>
                                <div id="rating-hider">
                                    <xsl:value-of select="aspdnsf:ProductRatings(ProductID, 0, 0, 0, 1)" disable-output-escaping="yes"/>
                                </div>
                                <!-- END REMOVES RATING IMAGES BUT NOT TEXT AND STARS-->
    
                            </xsl:if>
                        </xsl:otherwise>
                    </xsl:choose>
    
    
                </xsl:template>
    
            </xsl:stylesheet>
        </PackageTransform>
    </package>

  37. #37
    AlanL is offline Junior Member
    Join Date
    Oct 2011
    Posts
    2

    Default Using this method with a secure domain

    So i'm getting a security warning out of Chrome. Everything works great, otherwise. Any ideas on how we can make this play nice with https domains?

    Thanks
    Alan

  38. #38
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    I have been try to change this, to work with SKU rather then productId for days now but no luck.... Any body knows what i can do
    Sorry to keep asking...


    Quote Originally Posted by tito View Post
    I am using Imagenameoveride
    example http://australia.continentalclothing...edium/EP40.jpg

    what code do i change in the XML
    Is this the code i need to edit ..

    HTML Code:
    !-- start of setting the image link for product pages -->
    			<xsl:param name="image_link">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>images/Product/medium/<xsl:value-of select="/root/QueryString/productid"/>.jpg</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the image link for product pages -->
    Gordon

    8.1.1

  39. #39
    mikemurphy is offline Senior Member
    Join Date
    Mar 2006
    Location
    United Kingdom
    Posts
    207

    Default

    Installed the code all fine and checked.

    Getting this error though...

    The app ID "334281766603203" specified within the "fb:app_id" meta tag was invalid.

    The facebook dev object debugger says this is the error

    Object Invalid Value Object at URL 'http://www.thefreemason.com/p-486-craft-master-mason-apron.aspx' of type 'product' is invalid because the given value '333934179971295' for property 'fb:admins' could not be parsed as type 'fbid'.

    Any ideas ?
    8.0.1.4 W2008R2 64-bit MSSQL2005

  40. #40
    don.irwin is offline Member
    Join Date
    Apr 2006
    Location
    Phoenix AZ
    Posts
    81

    Default

    use your own id for fb:abmin - https://developers.facebook.com/docs/reference/api/

    Quote Originally Posted by mikemurphy View Post
    Installed the code all fine and checked.

    Getting this error though...

    The app ID "334281766603203" specified within the "fb:app_id" meta tag was invalid.

    The facebook dev object debugger says this is the error

    Object Invalid Value Object at URL 'http://www.thefreemason.com/p-486-craft-master-mason-apron.aspx' of type 'product' is invalid because the given value '333934179971295' for property 'fb:admins' could not be parsed as type 'fbid'.

    Any ideas ?

  41. #41
    deanfp is offline Senior Member
    Join Date
    May 2009
    Location
    Sweden
    Posts
    556

    Default

    Found this site that is the same as addthis.com but has a facebook like/subscribe built in.

    http://sharethis.com

  42. #42
    tito is offline Senior Member
    Join Date
    Sep 2005
    Posts
    213

    Default

    Nice thank you for this nice find .. :-)
    Gordon

    8.1.1

  43. #43
    mikemurphy is offline Senior Member
    Join Date
    Mar 2006
    Location
    United Kingdom
    Posts
    207

    Default

    I get an issue where the tags generated are showing the product name twice

    <meta property="og:title" content="What Do You Know About The Royal ArchWhat Do You Know About The Royal Arch" />

    any thoughts on a fix ?
    8.0.1.4 W2008R2 64-bit MSSQL2005

  44. #44
    jreigh@steelcitysupply.co is offline Junior Member
    Join Date
    May 2011
    Location
    Pittsburgh, PA
    Posts
    2

    Default ShareThis Installation Question

    Where do i paste the code for ShareThis? I have the code pasted in the template header, but I do not know where to paste the code on the product page.

    Quote Originally Posted by deanfp View Post
    Found this site that is the same as addthis.com but has a facebook like/subscribe built in.

    http://sharethis.com

  45. #45
    brianaikin is offline Junior Member
    Join Date
    Apr 2012
    Posts
    1

    Default Facebook xmlpackage does not load?

    I keep getting an error when uploading the facebook.xml.config file? I made the recommended changes, but get a critical file error when trying to upload to the xmlPackages root dir. Reason for error says "could not start transfer..." ?

    Any suggestions?

    Thanks in advance!

  46. #46
    wing43215 is offline Junior Member
    Join Date
    Sep 2009
    Posts
    19

    Default Another Image Problem

    I have another Image Problem. I see 'view larger image' instead of the actual image of the product from the site. Any Ideas? Running 9.3Mx

    Name:  view large.jpg
Views: 44
Size:  26.7 KBName:  view large 2.jpg
Views: 44
Size:  83.3 KB

    I used this xml package:

    Code:
    <?xml version="1.0" standalone="yes" ?>
    <package version="2.1" displayname="BFGs Facebook / rel canonical package" debug="false" includeentityhelper="false" allowengine="true">
    
        <query name="Products" rowElementName="Product">
            <sql>
                <![CDATA[
                    SELECT Name, Description FROM Product WHERE ProductID = @ProductID
                ]]>
            </sql>
            <queryparam paramname="@ProductID"       paramtype="request" requestparamname="ProductID"       sqlDataType="int" defvalue="0"  validationpattern="^\d{1,10}$" />
        </query>
    
    
        <PackageTransform>
            <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="xml" omit-xml-declaration="yes" />
    
                <xsl:template match="/">
    
    <!-- start of edit this to show your domain - N.B. don't forget the slash at the end -->
    <xsl:param name="site">http://www.sitename.co.uk/</xsl:param>
    <!-- end of edit this to show your domain - N.B. don't forget the slash at the end -->
    
    
    <!-- start of setting the canonical link for category & product pages -->
    			<xsl:param name="canonical">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/pagenum)"><xsl:value-of select="$site"/>c-<xsl:value-of select="/root/QueryString/categoryid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx?pagenum=<xsl:value-of select="/root/QueryString/pagenum"/></xsl:when>
    <xsl:when test="/root/System/PageName = 'showcategory.aspx' and boolean(/root/QueryString/categoryid)"><xsl:value-of select="$site"/>c-<xsl:value-of select="/root/QueryString/categoryid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx</xsl:when>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>p-<xsl:value-of select="/root/QueryString/productid"/>-<xsl:value-of select="/root/QueryString/sename"/>.aspx</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the canonical link for category & product pages -->
    				
    <!-- start of setting the image link for product pages -->
    			<xsl:param name="image_link">
    				<xsl:choose>
    <xsl:when test="/root/System/PageName = 'showproduct.aspx' and boolean(/root/QueryString/productid)"><xsl:value-of select="$site"/>images/Product/medium/<xsl:value-of select="/root/QueryString/productid"/>.jpg</xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the image link for product pages -->
    				
    <!-- start of setting the product name for product pages -->
    			<xsl:param name="prod_name">
    				<xsl:choose>
    <xsl:when test="boolean(/root/Products/Product/Name)"><xsl:value-of select="/root/Products/Product/Name"/></xsl:when>
    					<xsl:otherwise>0</xsl:otherwise>
    				</xsl:choose>
    			</xsl:param>
    <!-- end of setting the product name for product pages -->
    				
    				
    <!-- start of setting the product description for product pages (including stripping html tags) -->
    <xsl:param name="ProductDesc" >
    <xsl:value-of select="/root/Products/Product/Description" disable-output-escaping="yes" />
    </xsl:param>        
    	<xsl:variable name="pureText">
                <xsl:call-template name="removeHtmlTags">
                    <xsl:with-param name="html" select="$ProductDesc"/>
                </xsl:call-template>
            </xsl:variable>
    <xsl:variable name="FBDesc" ><xsl:value-of select="substring($pureText, 0, 250)" /></xsl:variable>  
    <!-- end of setting the product description for product pages (including stripping html tags) -->
    
    <!-- start of rel canonical DELETE THIS IF YOU DON'T WANT IT -->	
    <xsl:choose>
    <xsl:when test="$canonical != 0">
    <link rel="canonical" href="{$canonical}" />
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    <!-- end of rel canonical DELETE THIS IF YOU DON'T WANT IT -->
    	
    	
    <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->	
    <xsl:choose>
    <xsl:when test="$image_link != 0">
    <meta property="og:title" content="{$prod_name}"/>
    <meta property="og:type" content="product"/>
    <meta property="og:image" content="{$image_link}"/>
    <meta property="og:url" content="{$canonical}"/>
    <meta property="og:description" content="{$FBDesc}"/>
    <meta property="og:site_name" content="SKaters Choice Skate Shop"/>
    <meta property="fb:admins" content="745596564"/>
    <link rel="image_src" href="{$image_link}" />
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    <!-- start of og tags REMEMBER TO EDIT THE ADMIN ID TO MATCH YOUR OWN AND THE SITE NAME TOO-->	
    	
    	
                </xsl:template>
    	    
    	    
                
    <!-- start of template to strip html tags -->	
    <xsl:template name="removeHtmlTags">
        <xsl:param name="html"/>
        <xsl:choose>
          <xsl:when test="contains($html, '&lt;')">
            <xsl:value-of select="substring-before($html, '&lt;')"/>
            <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>	    
    <!-- end of template to strip html tags -->
    	    
            </xsl:stylesheet>
        </PackageTransform>
    </package>