Skip to content

Instantly share code, notes, and snippets.

View ctbarber's full-sized avatar

Todd Barber ctbarber

View GitHub Profile
<table class="snippet-media-object">
<tbody>
<tr class="uthsc-ouc-instructions"><th colspan="2">Media Object Directions [do not delete]</th></tr>
<tr class="uthsc-ouc-instructions">
<td colspan="2">Useful for displaying an item, usually an image, alongside some content, usually text. You could put lists, grids, or even other media objects inside.</td>
</tr>
<tr>
<td class="uthsc-ouc-instructions">Vertical alignment of the media object? Default is top. Other choices are middle and bottom.</td>
<td>top</td>
</tr>
<!-- begin template match for image navigation snippet -->
<xsl:template match="table[@class='snippet-image-navigation']" mode="copy">
<xsl:variable name="thumbnail-inside-container">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = '6'">
<xsl:text>small-up-2 medium-up-3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>small-up-2 medium-up-4 large-up-2</xsl:text>
</xsl:otherwise>
<table class="snippet-image-navigation">
<tbody>
<tr class="uthsc-ouc-instructions"><th colspan="2">Image Navigation Directions [do not delete]</th></tr>
<tr class="uthsc-ouc-instructions">
<td colspan="2">Useful for a secondary navigation on the page. Allows for a "showcase" image, and then 4 or 6 smaller images that can be used for navigation purposes.</td>
</tr>
<tr>
<td class="uthsc-ouc-instructions">How many navigation items do you want? 4 or 6. (Default is 4.)</td>
<td>4</td>
</tr>
<!-- begin template match to strip anchor tags from highlight box -->
<xsl:template match="table[@class='snippet-highlight-box']/tbody/tr/*/a" priority="3" mode="copy">
<xsl:apply-templates />
</xsl:template>
<!-- end template match to strip anchor tags from highlight box -->
<!-- begin template match for highlight box snippet -->
<xsl:template match="table[@class='snippet-highlight-box']" mode="copy">
<xsl:variable name="highlight-color">
<table class="snippet-highlight-box">
<tbody>
<tr class="uthsc-ouc-instructions"><th>Highlight Box Directions [do not delete]</th><th>Content [edit this column to display on the page]</th></tr>
<tr>
<td class="uthsc-ouc-instructions">The main color of the highlight box. It will be the color of the Heading and the color of the background when someone hovers over it. Your choices are green, blue, or purple. (blue is the default.)</td>
<td>blue</td>
</tr>
<tr>
<td class="uthsc-ouc-instructions">Do you want a light gray border around the highlight box? (yes or no) Should only be used when there is no image and no background. Default is no.</td>
<td>no</td>
<!-- begin template match for video snippet -->
<xsl:template match="table[@class='snippet-flex-video']" mode="copy">
<xsl:variable name="widescreen">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[2]/td[2]/node()) = 'yes'">
<xsl:text> widescreen</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- this sets class name and by default it is not included so no class needed -->
</xsl:otherwise>
<table class="snippet-flex-video">
<tbody>
<tr class="uthsc-ouc-instructions"><th>Flex Video Directions [do not delete]</th><th>Content [edit this column to display on the page]</th></tr>
<tr>
<td class="uthsc-ouc-instructions">Is this video widescreen? By default, the video will be a 4:3 ratio. If your video is 16:9, then change this to yes. The default is no.</td>
<td>no</td>
</tr>
<tr>
<td class="uthsc-ouc-instructions">Is the video stored on Vimeo? We have to do a little bit more trickery if the video is hosted by Vimeo. If it is, change this to yes. The default is no.</td>
<td>no</td>
<!-- begin template match for figure snippet -->
<xsl:template match="table[@class='snippet-figure']" mode="copy">
<xsl:variable name="figure-alignment">
<xsl:choose>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'none'">
<xsl:text></xsl:text>
</xsl:when>
<xsl:when test="lower-case(tbody/tr[3]/td[2]/node()) = 'right'">
<xsl:text>right </xsl:text>
<table class="snippet-figure">
<tbody>
<tr class="uthsc-ouc-instructions"><th colspan="2">Figure Options [DO NOT DELETE]</th></tr>
<tr class="uthsc-ouc-instructions"><th colspan="2">Normally used to put an image on a page, but can also be used for videos, code, and other things.</th></tr>
<tr>
<td class="uthsc-ouc-instructions">
<p>How do you want the figure aligned? Choices are left, right, or none. (left is default.)</p>
</td>
<td>
<p>left</p>
<!-- begin template match for FAQ snippet -->
<xsl:template match="table[@class='snippet-faq']" mode="copy">
<div class="uthsc-faq">
<xsl:for-each select="tbody/tr">
<xsl:if test="position() > 3">
<xsl:variable name="anchor-link">
<xsl:choose>
<xsl:when test="string-length(normalize-space(td[3])) > 1">
<xsl:value-of select="lower-case(replace(replace(td[3], '[^a-zA-Z0-9 ]', ''),' ', '-'))" />
</xsl:when>