Skip to content
Snippets Groups Projects
Commit 1c28082f authored by Fernando Pietchaki Domingues's avatar Fernando Pietchaki Domingues
Browse files

Adicionado código gerador do Trail

parent 8ae05f71
No related branches found
No related tags found
No related merge requests found
...@@ -72,6 +72,9 @@ ...@@ -72,6 +72,9 @@
<xsl:call-template name="buildHeader"/> <xsl:call-template name="buildHeader"/>
--> -->
<!--The trail is built by applying a template over pageMeta's trail children. -->
<xsl:call-template name="buildTrail"/>
<!-- <!--
Goes over the document tag's children elements: body, options, meta. The body template Goes over the document tag's children elements: body, options, meta. The body template
generates the ds-body div that contains all the content. The options template generates generates the ds-body div that contains all the content. The options template generates
...@@ -803,4 +806,80 @@ ...@@ -803,4 +806,80 @@
<xsl:template match="dri:options">&#160; <xsl:template match="dri:options">&#160;
</xsl:template> </xsl:template>
<!-- ******************************************************************** -->
<xsl:template name="buildTrail">
<div id="ds-trail-wrapper">
<ul id="ds-trail">
<!-- Display a language selection if more than 1 language is supported -->
<xsl:if
test="count(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']) &gt; 1">
<div id="ds-language-selection">
<xsl:for-each
select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']">
<xsl:variable name="locale" select="." />
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat($context-path,'/?locale-attribute=')" />
<xsl:value-of select="$locale" />
</xsl:attribute>
<xsl:value-of
select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='supportedLocale'][@qualifier=$locale]" />
</a>
</xsl:for-each>
</div>
</xsl:if>
<xsl:choose>
<xsl:when test="starts-with($request-uri, 'page/about')">
<li class="ds-trail-link first-link">
<i18n:text>xmlui.structure.AboutRepositoryTrail</i18n:text>
</li>
</xsl:when>
<xsl:when test="count(/dri:document/dri:meta/dri:pageMeta/dri:trail) = 0">
<li class="ds-trail-link first-link">-</li>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="/dri:document/dri:meta/dri:pageMeta/dri:trail"/>
</xsl:otherwise>
</xsl:choose>
</ul>
</div>
</xsl:template>
<xsl:template match="dri:trail">
<!--put an arrow between the parts of the trail-->
<xsl:if test="position()>1">
<li class="ds-trail-arrow">
<xsl:text>&#8594;</xsl:text>
</li>
</xsl:if>
<li>
<xsl:attribute name="class">
<xsl:text>ds-trail-link </xsl:text>
<xsl:if test="position()=1">
<xsl:text>first-link </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text>last-link</xsl:text>
</xsl:if>
</xsl:attribute>
<!-- Determine whether we are dealing with a link or plain text trail link -->
<xsl:choose>
<xsl:when test="./@target">
<a>
<xsl:attribute name="href">
<xsl:value-of select="./@target"/>
</xsl:attribute>
<xsl:apply-templates />
</a>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates />
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>
<!-- ******************************************************************** -->
</xsl:stylesheet> </xsl:stylesheet>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment