podcast: limit to 23 items per feed

This commit is contained in:
Astro 2011-11-14 02:15:26 +01:00
parent dae0cfd707
commit 02ce095486
1 changed files with 30 additions and 28 deletions

View File

@ -96,34 +96,36 @@
<xsl:for-each select="newsfile">
<xsl:sort select="date:seconds(document(.)/item/@date)" data-type="number" order="descending" />
<xsl:choose>
<xsl:when test="($selection = 'pentaradio' or $selection = 'pentamedia') and
starts-with(., 'content/news/pentaradio') and
count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($selection = 'pentacast' or $selection = 'pentamedia') and
starts-with(., 'content/news/pentacast') and
count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($selection = 'pentamusic' or $selection = 'pentamedia') and
starts-with(., 'content/news/pentamusic') and
count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$selection = '' and count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
<xsl:if test="position() &lt;= 23">
<xsl:choose>
<xsl:when test="($selection = 'pentaradio' or $selection = 'pentamedia') and
starts-with(., 'content/news/pentaradio') and
count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($selection = 'pentacast' or $selection = 'pentamedia') and
starts-with(., 'content/news/pentacast') and
count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="($selection = 'pentamusic' or $selection = 'pentamedia') and
starts-with(., 'content/news/pentamusic') and
count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$selection = '' and count(document(.)/item//resource) &gt; 0">
<xsl:apply-templates select="document(.)/item//resource" mode="preselect">
<xsl:with-param name="newsfile" select="."/>
</xsl:apply-templates>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</channel>