Page 5 of 5 FirstFirst ... 345
Results 41 to 46 of 46

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

  1. #41
    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

  2. #42
    Join Date
    Sep 2005
    Posts
    213

    Default

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

    8.1.1

  3. #43
    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

  4. #44
    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

  5. #45
    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!

  6. #46
    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

    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, '&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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •