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
view large.jpgview large 2.jpg
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, '<')">
<xsl:value-of select="substring-before($html, '<')"/>
<xsl:call-template name="removeHtmlTags">
<xsl:with-param name="html" select="substring-after($html, '>')"/>
</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>