Common XSL Patterns

  •  

data list common templates and patterns

<!-- classifications -->
<xsl:template match="Provider_Languages" mode="fieldProcessor" >
<xsl:param name="Node">
</xsl:param>
<xsl:if test="$Node/Classifications/Classification[@Name='Provider Languages']/Attribute != ''">
    <div class="column languages">
      <span class="label">Languages:</span>
      <div class="values">
        <xsl:apply-templates select="$Node/Classifications/Classification[@Name='Provider Languages']/Attribute" mode="Provider_Languages" disable-output-escaping="yes">
        </xsl:apply-templates>
        <xsl:comment>Provider Language</xsl:comment>
      </div>
    </div>
</xsl:if>        
</xsl:template>
<xsl:template match="Attribute" mode="Provider_Languages">
<span class="value">
  <xsl:value-of select="." disable-output-escaping="yes">
  </xsl:value-of>
</span>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:template>

data detail common templates and patterns

<!-- classifications -->
<xsl:template match="Provider_Languages" mode="fieldProcessor" >
<xsl:param name="Node">
</xsl:param>
<xsl:if test="$Node/Classifications/Classification[Name='Provider Languages']/Item != ''">
    <div class="column languages">
      <span class="label">Languages:</span>
      <div class="values">
        <xsl:apply-templates select="$Node/Classifications/Classification[Name='Provider Languages']/Item" mode="Provider_Languages">
        </xsl:apply-templates>
        <xsl:comment>Provider Language</xsl:comment>
      </div>
    </div>
</xsl:if>        
</xsl:template>
<xsl:template match="Item" mode="Provider_Languages">
<span class="value">
  <xsl:value-of select="." disable-output-escaping="yes" />
</span>
<xsl:if test="position() != last()">, </xsl:if>
</xsl:template>

Strip image sizing and make medium

<xsl:choose>
    <xsl:when test=". !='' and contains(.,'?')">
      <img src="{substring-before(.,'?')}?Medium" />
    </xsl:when>
    <xsl:when test=". != ''">
      <img src="{.}?Medium" />
    </xsl:when>
</xsl:choose>

override ImageFile in filter gallery to show image itself instead of teaser image

<xsl:template match="ImageFile" mode="oneField">
        <xsl:param name="StyleNode" />
        <img src="{../LinkParameter}?Medium" alt="{../ImageAltText}" title="{../ImageAltText}"/>
    </xsl:template>        

 

© 2017 Northwoods - all rights reserved.
top