diff options
Improved article stream title-text template
* returns "Start" for the first page instead of "Page 0"
** this corresponds to the navigation
* changed "Start" navigation link in master template
* i.e. the index page is named "0", server config will have to be changed accordingly
** thought about generating it as "index" directly
** while this is possible using the XPath evaluation functionality of the target meta attribute the lack of a if-statement in XPath 1.0 would require a very ugly workaround (e.g. the answer to http://stackoverflow.com/questions/971067/is-there-an-if-then-else-statement-in-xpath)
-rw-r--r-- | source/99_result/stream.xsl | 9 | ||||
-rw-r--r-- | utility/master.xsl | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/99_result/stream.xsl b/source/99_result/stream.xsl index 2d28043..603e574 100644 --- a/source/99_result/stream.xsl +++ b/source/99_result/stream.xsl @@ -22,7 +22,14 @@ </xsl:variable> <xsl:template name="title-text"> - <xsl:value-of select="/datasource/page/entry/@index"/> + <xsl:choose> + <xsl:when test="/datasource/page/entry/@index = 0"> + Start + </xsl:when> + <xsl:otherwise> + Page <xsl:value-of select="/datasource/page/entry/@index"/> + </xsl:otherwise> + </xsl:choose> </xsl:template> <xsl:template name="get_article"> diff --git a/utility/master.xsl b/utility/master.xsl index cbc008b..698aed5 100644 --- a/utility/master.xsl +++ b/utility/master.xsl @@ -47,7 +47,7 @@ <div id="nav_wrap"> <h1><xsl:value-of select="datasource/meta/title"/></h1> <ul> - <li><a href="{$url}">Start</a></li> + <li><a href="{$url}/0">Start</a></li> <li><a href="{$url}/archive">Archive</a></li> <li><a href="{$url}/projects">Projects</a></li> <li><a href="{$url}/page/contact">Contact</a></li> |