after every 5 news, show the subscribe/supporter banner

This commit is contained in:
Reinhard Müller 2022-03-31 12:27:48 +02:00 committed by max.mehl
parent dbb2df5c2a
commit f7fe0b3554
Signed by: max.mehl
GPG Key ID: 2704E4AB371E2E92
3 changed files with 20 additions and 0 deletions

View File

@ -31,4 +31,7 @@
<include-news/>
</body>
<banner1><module id="banner-subscribe" /></banner1>
<banner2><module id="banner-become-supporter" /></banner2>
</html>

View File

@ -103,6 +103,20 @@
]">
<xsl:sort select="@date" order="descending"/>
<!-- Before every 5 news, show a banner, depending on even or odd number of position in loop -->
<xsl:if test="position() mod 5 = 0">
<xsl:choose>
<!-- even number -->
<xsl:when test="position() mod 2 = 0">
<xsl:apply-templates select="/buildinfo/document/banner1/node()" />
</xsl:when>
<!-- odd number -->
<xsl:otherwise>
<xsl:apply-templates select="/buildinfo/document/banner2/node()" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<!-- Display the news items -->
<xsl:apply-templates select="."/>

View File

@ -34,4 +34,7 @@
<a class="learn-more" href="2020/index.html"/>
</p>
</body>
<banner1><module id="banner-subscribe" /></banner1>
<banner2><module id="banner-become-supporter" /></banner2>
</html>