Created
April 4, 2017 17:06
-
-
Save ctbarber/26c85e6c92e819ca089b05eebeee89bc to your computer and use it in GitHub Desktop.
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
<!-- template match for block grid snippet --> | |
<xsl:template match="table[@class='snippet-block-grid']" mode="copy"> | |
<xsl:variable name="medium-grid"> | |
<xsl:choose> | |
<xsl:when test="lower-case(tbody/tr[2]/td[2]/node()) = '3'"> | |
<xsl:text>medium-up-3</xsl:text> | |
</xsl:when> | |
<xsl:when test="lower-case(tbody/tr[2]/td[2]/node()) = '4'"> | |
<xsl:text>medium-up-4</xsl:text> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:text>medium-up-2</xsl:text> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
<xsl:variable name="large-grid"> | |
<xsl:choose> | |
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = '3'"> | |
<xsl:text>large-up-3</xsl:text> | |
</xsl:when> | |
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = '5'"> | |
<xsl:text>large-up-5</xsl:text> | |
</xsl:when> | |
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = '6'"> | |
<xsl:text>large-up-6</xsl:text> | |
</xsl:when> | |
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = '7'"> | |
<xsl:text>large-up-7</xsl:text> | |
</xsl:when> | |
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = '8'"> | |
<xsl:text>large-up-8</xsl:text> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:text>large-up-4</xsl:text> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
<div class="row uthsc-block-grid {$medium-grid} {$large-grid}"> | |
<xsl:for-each select="tbody/tr/td"> | |
<xsl:if test="position() > 5"> | |
<xsl:if test="*"> | |
<div class="column"> | |
<xsl:apply-templates select="node()" mode="copy"/> | |
</div> | |
</xsl:if> | |
</xsl:if> | |
</xsl:for-each> | |
</div> | |
</xsl:template> | |
<!-- end template match for block grid snippet --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment