Created
May 10, 2012 14:42
-
-
Save xpathr/2653576 to your computer and use it in GitHub Desktop.
Twitter Button Utility by bzerangue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- | |
Twitter Button: XSL Utility | |
Created by Brian Zerangue on 2011-08-31. | |
--> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:template name="twitter-button"> | |
<xsl:param name="data-url" /> <!-- required --> | |
<xsl:param name="data-via" /> <!-- optional // use your screenname --> | |
<xsl:param name="data-text" /> <!-- optional --> | |
<xsl:param name="data-related" /> <!-- optional --> | |
<xsl:param name="data-count" select="'none'"/> <!-- options // horizontal, vertical, none --> | |
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script> | |
<div> | |
<a href="http://twitter.com/share" class="twitter-share-button"> | |
<xsl:attribute name="data-url"> | |
<xsl:value-of select="$data-url" /> | |
</xsl:attribute> | |
<xsl:if test="$data-via!=''"> | |
<xsl:attribute name="data-via"> | |
<xsl:value-of select="$data-via" /> | |
</xsl:attribute> | |
</xsl:if> | |
<xsl:if test="$data-text!=''"> | |
<xsl:attribute name="data-text"> | |
<xsl:value-of select="$data-text" /> | |
</xsl:attribute> | |
</xsl:if> | |
<xsl:if test="$data-related!=''"> | |
<xsl:attribute name="data-related"> | |
<xsl:value-of select="$data-related" /> | |
</xsl:attribute> | |
</xsl:if> | |
<xsl:attribute name="data-count"> | |
<xsl:value-of select="$data-count" /> | |
</xsl:attribute> | |
<xsl:text>Tweet</xsl:text> | |
</a> | |
</div> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment