Skip to content

Instantly share code, notes, and snippets.

@DWboutin
Created July 17, 2015 18:50
Show Gist options
  • Save DWboutin/e9b06b0fb12a5c94479e to your computer and use it in GitHub Desktop.
Save DWboutin/e9b06b0fb12a5c94479e to your computer and use it in GitHub Desktop.
Base style for a XSL style template
<xsl:template name="ListeActualites" match="Row[@Style='ListeActualites']" mode="itemstyle">
<xsl:param name="CurPos" />
<xsl:param name="Last" />
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="Image">
<xsl:value-of select="substring-before(substring-after(@Image, 'src=&quot;'), '&quot; style')" />
</xsl:variable>
<xsl:variable name="debutBloc">
<xsl:if test="$CurPos = 1">
<![CDATA[
<div class="test">
]]>
</xsl:if>
</xsl:variable>
<xsl:variable name="finBloc">
<xsl:if test="$CurPos = $Last">
<![CDATA[
</div>
]]>
</xsl:if>
</xsl:variable>
<xsl:value-of select="$debutBloc" disable-output-escaping="yes" />
<!-- Content here -->
<xsl:value-of select="$finBloc" disable-output-escaping="yes" />
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment