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-94f89814c4dfmaster
parent
33d839971d
commit
92461fdc4a
|
|
@ -48,7 +48,17 @@
|
|||
</foundry:doc-see-also>
|
||||
</foundry:doc>
|
||||
<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>
|
||||
|
||||
<foundry:doc section="user"
|
||||
|
|
|
|||
|
|
@ -946,6 +946,9 @@
|
|||
</xsl:function>
|
||||
|
||||
<xsl:function name="foundry:title" as="xs:string">
|
||||
<xsl:param name="useCategoryMenu"/>
|
||||
<xsl:param name="useRootCategoryIndexItemTitle"/>
|
||||
|
||||
<xsl:choose>
|
||||
<!-- Use fixed title for some special content items -->
|
||||
<xsl:when test="$data-tree//cms:contentPanel">
|
||||
|
|
@ -983,11 +986,11 @@
|
|||
<!-- Title for content section-->
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$data-tree/nav:categoryMenu//nav:category[@isSelected='true']">
|
||||
<xsl:for-each select="$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[@id=$useCategoryMenu]//nav:category[@isSelected='true']">
|
||||
<xsl:choose>
|
||||
<!-- 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:when test="$data-tree//title">
|
||||
<xsl:variable name="page-title">
|
||||
|
|
|
|||
Loading…
Reference in New Issue