Skip to content

Instantly share code, notes, and snippets.

@uniquelau
Last active December 14, 2015 07:18
Show Gist options
  • Save uniquelau/5049206 to your computer and use it in GitHub Desktop.
Save uniquelau/5049206 to your computer and use it in GitHub Desktop.
Rough working of a 'recall' template, that allows the media templates to be 'recalled', allowing content to be wrapped around the Video, Image, without having to write a whole template. (less duplication!)
<!-- CUSTOM :: Support to 'recall' a template -->
<xsl:template match="Image" mode="media.recall">
<xsl:param name="class"/>
<xsl:param name="crop"/>
<xsl:param name="size"/>
<xsl:param name="id"/>
<xsl:call-template name="GenericImage">
<xsl:with-param name="class" select="$class"/>
<xsl:with-param name="crop" select="$crop"/>
<xsl:with-param name="id" select="$id"/>
<xsl:with-param name="size" select="$size"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="Image" priority="1">
<article>
<h1><xsl:value-of select="@nodeName" />
<a href="image/{@id}">
<xsl:apply-templates select="." mode="media.recall">
<xsl:with-param name="crop" select="'gallery'" />
</xsl:apply-templates>
</a>
</article>
<!-- Here we wrap some data around our standard 'Image' template -->
</xsl:template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment