Skip to content

Instantly share code, notes, and snippets.

View ctbarber's full-sized avatar

Todd Barber ctbarber

View GitHub Profile
<!-- 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>
<table class="snippet-block-grid">
<tbody>
<tr class="uthsc-ouc-instructions"><th colspan="2">Block Grid Options [DO NOT DELETE]</th></tr>
<tr>
<td class="uthsc-ouc-instructions">
<p>How many columns do you want on tablet? Number between 2 - 4. (2 is default.)</p>
</td>
<td>
<p>2</p>
</td>
<!-- begin template match for Tabs snippet -->
<xsl:template match="table[@class='snippet-tabs']" mode="copy">
<xsl:variable name="tabs-id" select="generate-id()" />
<xsl:variable name="tabs-orientation">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[2]/td[2]/node()) = 'vertical'">
<xsl:text> vertical</xsl:text>
</xsl:when>
<xsl:otherwise>
<table class="snippet-tabs">
<tbody>
<tr class="uthsc-ouc-instructions"><th colspan="2">Tabs Options [DO NOT DELETE]</th></tr>
<tr>
<td class="uthsc-ouc-instructions">
<p>Do you want the tabs to be horizontal or vertical? (Horizontal is default.)<br /><br />Horizontal tabs will go across the top. Vertical will be stacked to the left of the content. Use the size below to determine how wide the tabs are for vertical.</p>
</td>
<td>
<p>horizontal</p>
</td>
<!-- begin template match for page intro snippet -->
<xsl:template match="table[@class='snippet-page-intro']" mode="copy">
<div class="uthsc-page-opening">
<xsl:if test="tbody/tr[2]/td[2]/*">
<h3 class="uthsc-page-intro"><xsl:apply-templates select="tbody/tr[2]/td[2]/p[1]/node()" mode="copy"/></h3>
</xsl:if>
<xsl:if test="tbody/tr[3]/td[2]/*">
<p class="uthsc-page-lead"><xsl:apply-templates select="tbody/tr[3]/td[2]/p[1]/node()" mode="copy"/></p>
<!--<p class="uthsc-page-lead"><xsl:copy select="tbody/tr[3]/td[2]/p/*" /></p>-->
</xsl:if>
<table class="snippet-page-intro">
<tbody>
<tr class="uthsc-ouc-instructions"><th>Page Heading Directions [do not delete]</th><th>Page Heading Content [edit this column to display on the page]</th></tr>
<tr>
<td class="uthsc-ouc-instructions">The "intro" to a page. This text should be no more than a sentence and maybe have some interesting fact. It will show as a green text.</td>
<td>
<p>Each fiscal year, our faculty and staff receive nearly $100 million in research funding, including support from National Institutes of Health grants and private foundations.</p>
</td>
</tr>
<tr>
<xsl:template name="check_for_news_boxes">
<xsl:if test="/document/main-content/rows/row/*/div/*/table/@class = 'snippet-news-boxes'">
<xsl:choose>
<xsl:when test="$ou:action = 'pub'">
<script src="/-resources/2015/js/uthsc-news-ajax.min.js"></script>
<script>
$(document).ready(function(){
<xsl:text disable-output-escaping="yes">
<!-- 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>
<table class="snippet-news-boxes">
<tbody>
<tr class="uthsc-ouc-instructions"><th>News Boxes Directions [do not delete]</th><th>Content [edit this column to display on the page]</th></tr>
<tr>
<td class="uthsc-ouc-instructions">What is the news category? If you don't know the number, contact webmaster@uthsc.edu.</td>
<td>10</td>
</tr>
<tr>
<td class="uthsc-ouc-instructions">How many news stories do you want to show up? (3 is default)</td>
<td>3</td>
<!-- begin template match for media object snippet -->
<xsl:template match="table[@class='snippet-media-object']" mode="copy">
<xsl:variable name="alignment">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'bottom'">
<xsl:text> bottom</xsl:text>
</xsl:when>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'middle'">
<xsl:text> middle</xsl:text>
</xsl:when>