Skip to content

Instantly share code, notes, and snippets.

@gerardpaapu
Created December 14, 2009 23:01
Show Gist options
  • Save gerardpaapu/256525 to your computer and use it in GitHub Desktop.
Save gerardpaapu/256525 to your computer and use it in GitHub Desktop.
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:media="http://search.yahoo.com/mrss"
exclude-result-prefixes="msxml umbraco.library media">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="allNodes"
select="umbraco.library:GetXmlNodeById(1186)/descendant-or-self::node [@nodeTypeAlias = 'umbracoBlogPost' and string(data [@alias='umbracoNaviHide']) != '1']"/>
<xsl:variable name="sizeConstant">90</xsl:variable>
<xsl:variable name="weightConstant">100</xsl:variable>
<xsl:template match="/">
<div id="cloud">
<xsl:for-each select="umbraco.library:GetPreValues(1179)//preValue">
<xsl:variable name="ratio" select="(count($allNodes [contains(./data [@alias='categories'], current())]) div count($allNodes)" />
<xsl:variable name="fontsize" select="round($ratio) * $sizeConstant)" />
<xsl:variable name="fontweight" select="round($ratio) * $weightConstant)" />
<a href="/?filterby={current()}" style="font-size: {$fontsize}px; font-weight:{$fontweight};">
<xsl:value-of select="."/>
</a>
<xsl:text> </xsl:text>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment