added capacity to handle multiple author names with links to article pages

svn path=/branches/design/; revision=17799
This commit is contained in:
samtuke 2010-10-20 10:08:24 +00:00
parent 8f951faa41
commit 20872f322b
1 changed files with 41 additions and 12 deletions

View File

@ -67,21 +67,50 @@
</xsl:copy>
<!-- Apply article rules -->
<xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name']/@content)">
<xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-1']/@content)">
<xsl:element name="div">
<xsl:attribute name="id">article-metadata</xsl:attribute>
<xsl:element name="p">
<span class="label"><xsl:apply-templates select="/buildinfo/textset/text[@id='author']/node()" />: </span>
<xsl:choose>
<xsl:when test="/buildinfo/document/head/meta[@name='author-link']">
<xsl:variable name="author-link" select="/buildinfo/document/head/meta[@name='author-link']/@content" />
<a rel='author' href='{$author-link}'>
<xsl:value-of select="/buildinfo/document/head/meta[@name='author-name']/@content" /> </a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/buildinfo/document/head/meta[@name='author-name']/@content" />
</xsl:otherwise>
</xsl:choose>
<xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-1']/@content)">
<span class="label"><xsl:apply-templates select="/buildinfo/textset/text[@id='author']/node()" />: </span>
<xsl:choose>
<xsl:when test="/buildinfo/document/head/meta[@name='author-link-1']">
<xsl:variable name="author-link-1" select="/buildinfo/document/head/meta[@name='author-link-1']/@content" />
<a rel='author' href='{$author-link}'>
<xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-1']/@content" /> </a>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-1']/@content" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-2']/@content)">
<xsl:choose>
<xsl:when test="/buildinfo/document/head/meta[@name='author-link-2']">
<xsl:variable name="author-link-2" select="/buildinfo/document/head/meta[@name='author-link-2']/@content" />
, <a rel='author' href='{$author-link}'>
<xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-2']/@content" /> </a>
</xsl:when>
<xsl:otherwise>
, <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-2']/@content" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-3']/@content)">
<xsl:choose>
<xsl:when test="/buildinfo/document/head/meta[@name='author-link-3']">
<xsl:variable name="author-link-3" select="/buildinfo/document/head/meta[@name='author-link-3']/@content" />
, <a rel='author' href='{$author-link}'>
<xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-3']/@content" /> </a>
</xsl:when>
<xsl:otherwise>
, <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-3']/@content" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<span class="label"> <xsl:apply-templates select="/buildinfo/textset/text[@id='published']/node()" />: </span><xsl:value-of select="/buildinfo/document/head/meta[@name='publication-date']/@content" />
</xsl:element>
</xsl:element>