Foundry: Make the <show-page-title> tag more flexible. It is now possible to customize the name of the category menu used and if the name of the root category or of its index item is used.

git-svn-id: https://svn.libreccm.org/ccm/trunk@3821 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2016-01-22 19:03:53 +00:00
parent 33d839971d
commit 92461fdc4a
2 changed files with 18 additions and 5 deletions

View File

@ -48,7 +48,17 @@
</foundry:doc-see-also> </foundry:doc-see-also>
</foundry:doc> </foundry:doc>
<xsl:template match="show-page-title"> <xsl:template match="show-page-title">
<xsl:value-of select="foundry:title()"/> <xsl:variable name="useCategoryMenu"
select="if(./@useCategoryMenu)
then ./@useCategoryMenu
else 'categoryMenu'"/>
<xsl:variable name="useRootCategoryIndexItemTitle"
select="if(./@useRootIndexItemCategoryTitle)
then foundry:boolean(./@useRootCategoryIndexItemTitle)
else false()"/>
<xsl:value-of select="foundry:title($useCategoryMenu,
$useRootCategoryIndexItemTitle)"/>
</xsl:template> </xsl:template>
<foundry:doc section="user" <foundry:doc section="user"

View File

@ -946,6 +946,9 @@
</xsl:function> </xsl:function>
<xsl:function name="foundry:title" as="xs:string"> <xsl:function name="foundry:title" as="xs:string">
<xsl:param name="useCategoryMenu"/>
<xsl:param name="useRootCategoryIndexItemTitle"/>
<xsl:choose> <xsl:choose>
<!-- Use fixed title for some special content items --> <!-- Use fixed title for some special content items -->
<xsl:when test="$data-tree//cms:contentPanel"> <xsl:when test="$data-tree//cms:contentPanel">
@ -983,11 +986,11 @@
<!-- Title for content section--> <!-- Title for content section-->
<xsl:otherwise> <xsl:otherwise>
<xsl:choose> <xsl:choose>
<xsl:when test="$data-tree/nav:categoryMenu//nav:category[@isSelected='true']"> <xsl:when test="$data-tree/nav:categoryMenu[@id=$useCategoryMenu]//nav:category[@isSelected='true']">
<xsl:for-each select="$data-tree/nav:categoryMenu//nav:category[@isSelected='true']"> <xsl:for-each select="$data-tree/nav:categoryMenu[@id=$useCategoryMenu]//nav:category[@isSelected='true']">
<xsl:choose> <xsl:choose>
<!-- Special rule: Use content item title for root-page in navigation --> <!-- Special rule: Use content item title for root-page in navigation -->
<xsl:when test="position() = last() and position() = 1"> <xsl:when test="position() = last() and position() = 1 and $useRootCategoryIndexItemTitle">
<xsl:choose> <xsl:choose>
<xsl:when test="$data-tree//title"> <xsl:when test="$data-tree//title">
<xsl:variable name="page-title"> <xsl:variable name="page-title">