Skip to content

Instantly share code, notes, and snippets.

@ctbarber
Created March 13, 2017 19:42
Show Gist options
  • Save ctbarber/e69058d382d643df1f7fa339b4652c58 to your computer and use it in GitHub Desktop.
Save ctbarber/e69058d382d643df1f7fa339b4652c58 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet SYSTEM "http://commons.omniupdate.com/dtd/standard.dtd">
<xsl:stylesheet version="3.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ou="http://omniupdate.com/XSL/Variables"
xmlns:ouc="http://omniupdate.com/XSL/Variables"
exclude-result-prefixes="xs ou ouc">
<xsl:import href="common.xsl"/>
<xsl:template name="uthsc_main_content">
<xsl:for-each select="main-content/rows/*">
<xsl:variable name="layout-structure" select="concat('layout-',position())"/>
<xsl:if test="ou:pcfparam($layout-structure) != 'hide'">
<xsl:variable name="row-expanded" select="concat('expanded-',position())"/>
<xsl:variable name="title" select="concat('row-title-',position())"/>
<xsl:variable name="row-background" select="concat('row-background-',position())"/>
<xsl:variable name="row-background-class">
<xsl:if test="normalize-space(ou:pcfparam($row-background)) != ''">
<xsl:value-of select="concat(' uthsc-row-bg uthsc-row-bg-',ou:pcfparam($row-background))" />
</xsl:if>
</xsl:variable>
<!-- <xsl:value-of select="ou:pcfparam($row-expanded)" /> -->
<xsl:if test="ou:pcfparam($title) != ''">
<xsl:text disable-output-escaping="yes">
&lt;div class="row uthsc-row-title"&gt;
</xsl:text>
<h2><xsl:value-of select="ou:pcfparam($title)"/></h2>
<xsl:text disable-output-escaping="yes">
&lt;/div&gt;
</xsl:text>
</xsl:if>
<xsl:choose>
<xsl:when test="ou:pcfparam($row-expanded) = 'normal-width'">
<xsl:value-of disable-output-escaping="yes"
select="concat('&lt;div class=&quot;row expanded',$row-background-class, '&quot;&gt;
&lt;div class=&quot;row&quot;&gt;')">
</xsl:value-of>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="yes">
&lt;div class="row expanded"&gt;
</xsl:text>
</xsl:otherwise>
</xsl:choose>
<!-- <xsl:if test="ou:pcfparam($title) != ''">
<xsl:text disable-output-escaping="yes">
&lt;div class="row uthsc-row-title"&gt;
</xsl:text>
<h2><xsl:value-of select="ou:pcfparam($title)"/></h2>
<xsl:text disable-output-escaping="yes">
&lt;/div&gt;
</xsl:text>
</xsl:if> -->
<xsl:choose>
<xsl:when test="ou:pcfparam($layout-structure) = 'full'">
<xsl:apply-templates select="./full/node()" mode="copy"/>
</xsl:when>
<xsl:when test="ou:pcfparam($layout-structure) = 'half'">
<xsl:apply-templates select="./half/node()" mode="copy"/>
</xsl:when>
<xsl:when test="ou:pcfparam($layout-structure) = 'heavy-left'">
<xsl:apply-templates select="./heavy-left/node()" mode="copy"/>
</xsl:when>
<xsl:when test="ou:pcfparam($layout-structure) = 'heavy-right'">
<xsl:apply-templates select="./heavy-right/node()" mode="copy"/>
</xsl:when>
<xsl:when test="ou:pcfparam($layout-structure) = 'heavy-middle'">
<xsl:apply-templates select="./heavy-middle/node()" mode="copy"/>
</xsl:when>
<xsl:when test="ou:pcfparam($layout-structure) = 'thirds'">
<xsl:apply-templates select="./thirds/node()" mode="copy"/>
</xsl:when>
<xsl:when test="ou:pcfparam($layout-structure) = 'fourths'">
<div class="medium-up-2 large-up-4">
<xsl:apply-templates select="./fourths/node()" mode="copy"/>
</div>
</xsl:when>
<xsl:otherwise />
</xsl:choose>
<xsl:choose>
<xsl:when test="ou:pcfparam($row-expanded) = 'normal-width'">
<xsl:text disable-output-escaping="yes">
&lt;/div&gt;
&lt;/div&gt;
</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text disable-output-escaping="yes">
&lt;/div&gt;
</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment