Bild für die gpn5-News

News-image als eigenes Template


git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@368 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2006-06-06 19:01:44 +00:00
parent 48fad59afd
commit de66e23d0b
3 changed files with 31 additions and 33 deletions

View File

@ -2,6 +2,7 @@
<!DOCTYPE item SYSTEM "http://www.c3d2.de/dtd/c3d2web.dtd">
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
<item title="GPN 5" date="2006-06-06T06:06:06" author="Astro" category="Gebarft">
<image title="GPN5: Smack my bit up">images/news/gpn5.jpg</image>
<p>
Nächstes Wochenende, vom 9. bis 11. Juni, findet in Karlsruhe die <link href="http://entropia.de/wiki/GPN5">GPN Programmiernacht 5</link> statt.
Das Dresdner Chaos ist dort ebenfalls anzutreffen.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -112,6 +112,7 @@
<h2>
<xsl:value-of select="$title" />
</h2>
<xsl:apply-templates/>
</div> <!-- id="content" -->
@ -173,38 +174,9 @@
</xsl:element>
<div class="news">
<xsl:choose>
<!--- <XXX> Kann das hier in ein Template? -->
<xsl:when test="image">
<img>
<xsl:attribute name="src"><xsl:value-of select="image"/></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="image/@title"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="image/@title"/></xsl:attribute>
<!-- News-Items haben ihre Bilder abwechselnd rechts und links... -->
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="$itemposition mod 2 = 0">
<xsl:text>left</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>right</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</img>
</xsl:when>
<xsl:otherwise>
<!-- TODO:
<xsl:call-template name="getimage">
<xsl:with-param name="category" select="@category" />
</xsl:call-template>
-->
</xsl:otherwise>
</xsl:choose>
<!-- </XXX> -->
<xsl:apply-templates/>
<xsl:apply-templates>
<xsl:with-param name="itemposition" select="$itemposition"/>
</xsl:apply-templates>
<xsl:if test="//addendum">
<p>
@ -222,7 +194,32 @@
</xsl:template>
<xsl:template match="item/image">
<!-- Nothing to do here, see above... -->
<xsl:param name="itemposition"/>
<img>
<xsl:choose>
<xsl:when test="contains(., '://')">
<xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="src"><xsl:value-of select="concat($baseurl, .)"/></xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="title"/></xsl:attribute>
<!-- News-Items haben ihre Bilder abwechselnd rechts und links... -->
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="$itemposition mod 2 = 0">
<xsl:text>left</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>right</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</img>
</xsl:template>
</xsl:stylesheet>