fallback image per class
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7897b06469
commit
77197c4977
|
@ -385,11 +385,22 @@
|
|||
</xsl:if>
|
||||
|
||||
<a href="{link}">
|
||||
<xsl:if test="content-image">
|
||||
<xsl:attribute name="style">
|
||||
background-image: url('<xsl:value-of select="content-image"/>');
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="content-image">
|
||||
<xsl:attribute name="style">
|
||||
background-image: url('<xsl:value-of select="content-image"/>');
|
||||
</xsl:attribute>
|
||||
</xsl:when>
|
||||
<xsl:otherwise><!-- Fallback image -->
|
||||
<xsl:choose><!-- depending on class -->
|
||||
<!-- todo: random image from list (filenames might be links), maybe based on hash() -->
|
||||
<xsl:when test="@class = 'news'"><xsl:attribute name="style">background-image: url('images/news/gchq-hdr.jpg');</xsl:attribute></xsl:when>
|
||||
<!--
|
||||
<xsl:when test="@class = 'wiki'"><xsl:attribute name="style">background-image: url('images/news/wikidata.png');</xsl:attribute></xsl:when>
|
||||
-->
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:apply-templates select="header"/>
|
||||
<xsl:apply-templates select="footer"/>
|
||||
|
|
Loading…
Reference in New Issue