first attempt at adding newsletter links to newsletter section of fp

svn path=/branches/design/; revision=18231
This commit is contained in:
samtuke committed 2010-11-10 13:14:37 +00:00
1 parent 4bc7674bb2
commit 8bdeae3a6b
1 file changed
+39
+39
View File
@@ -135,6 +135,45 @@
<h2><a href="/news/newsletter.html">Newsletter</a></h2>
<div class="entry">
<xsl:template match="/">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/html/body">
<body>
<xsl:apply-templates />
<!-- $today = current date (given as <html date="...">) -->
<xsl:variable name="today">
<xsl:value-of select="/html/@date" />
</xsl:variable>
<xsl:for-each select="/html/set/news[translate(@date,'-','') &lt;= translate($today,'-','')]">
<xsl:sort select="@date" order="descending"/>
<p>
<b><xsl:value-of select="@date" /></b><br/>
<xsl:value-of select="body"/>
<xsl:variable name="link"><xsl:value-of select="link"/></xsl:variable>
<xsl:if test="$link!=''">
[<a href="{link}"><xsl:value-of select="/html/text[@id='more']"/>]</a>
</xsl:if>
</p>
</xsl:for-each>
</body>
</xsl:template>
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="set"/>
<xsl:template match="text"/>
<p>
Subscribe to FSFE's monthly newsletter
</p>