convert to using small version of the image
This commit is contained in:
+27
-2
@@ -3,16 +3,41 @@
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:dt="http://xsltsl.org/date-time"
|
||||
xmlns:str="http://xsltsl.org/string"
|
||||
exclude-result-prefixes="dt">
|
||||
|
||||
<xsl:import href="../../tools/xsltsl/date-time.xsl"/>
|
||||
<xsl:import href="../../tools/xsltsl/string.xsl"/>
|
||||
|
||||
|
||||
<!-- ==================================================================== -->
|
||||
<!-- News image with or without link -->
|
||||
<!-- ==================================================================== -->
|
||||
|
||||
<!-- Define the URL of the image -->
|
||||
<xsl:template name="news-image">
|
||||
<xsl:param name="shrink" />
|
||||
<xsl:variable name="img-src">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$shrink = 'yes'">
|
||||
<xsl:call-template name="str:subst">
|
||||
<xsl:with-param name="text">
|
||||
<xsl:call-template name="str:subst">
|
||||
<xsl:with-param name="text" select="image/@url" />
|
||||
<xsl:with-param name="replace" select="'/big/'" />
|
||||
<xsl:with-param name="with" select="'/small/'" />
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="replace" select="'/medium/'" />
|
||||
<xsl:with-param name="with" select="'/small/'" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="image/@url"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
<!-- XML file provides a link (default for news items) -->
|
||||
<xsl:when test="link != ''">
|
||||
@@ -22,7 +47,7 @@
|
||||
</xsl:attribute>
|
||||
<xsl:element name="img">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="image/@url"/>
|
||||
<xsl:value-of select="$img-src"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="alt">
|
||||
<xsl:value-of select="image/@alt"/>
|
||||
@@ -37,7 +62,7 @@
|
||||
<xsl:otherwise>
|
||||
<xsl:element name="img">
|
||||
<xsl:attribute name="src">
|
||||
<xsl:value-of select="image/@url"/>
|
||||
<xsl:value-of select="$img-src"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="alt">
|
||||
<xsl:value-of select="image/@alt"/>
|
||||
|
||||
Reference in New Issue
Block a user