Created
March 27, 2017 19:28
-
-
Save ctbarber/303546dc2c910161bef7db1b9cb7d769 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
<!-- begin template match for news boxes snippet --> | |
<xsl:template match="table[@class='snippet-news-boxes']" mode="copy"> | |
<xsl:variable name="news-theme-color"> | |
<xsl:choose> | |
<xsl:when test="lower-case(tbody/tr[4]/td[2]/node()) = 'white'"> | |
<xsl:text></xsl:text> | |
</xsl:when> | |
<xsl:when test="lower-case(tbody/tr[4]/td[2]/node()) = 'green'"> | |
<xsl:text> uthsc-news-box-dark</xsl:text> | |
</xsl:when> | |
<xsl:otherwise> | |
<!-- this sets class name and by default it is blue so no class needed --> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:variable> | |
<xsl:variable name="news-id" select="generate-id()" /> | |
<xsl:choose> | |
<xsl:when test="$ou:action = 'pub'"> | |
<div class="news-snippet-{$news-id} row medium-up-2 large-up-3 {$news-theme-color}" data-equalizer="news-boxes-{$news-id}" data-equalize-on="large"></div> | |
<xsl:value-of select="concat('<?php $uthsc_news["',$news-id,'"] = array("post_count" => "',replace(tbody/tr[3]/td[2]/node(),' ',''),'", "categories" => "',tbody/tr[2]/td[2]/node(),'"); ?>')" disable-output-escaping="yes"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<div class="callout secondary"><p><span class="fa fa-info-circle fa-2x" style="vertical-align: -20%;margin-right: 0.3em;color:#002664;" aria-hidden="true"></span> The News will only show up once the page has been published.</p></div> | |
</xsl:otherwise> | |
</xsl:choose> | |
</xsl:template> | |
<!-- end template match for news boxes snippet --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment