It is now possible to assign different layout templates to for a content item depending if the content item is

displayed by a ContentItemPortlet, as a GreetingItem or as a normal item.


git-svn-id: https://svn.libreccm.org/ccm/trunk@3108 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2015-01-30 08:37:59 +00:00
parent 90187c1dd4
commit ea4326838d
3 changed files with 50 additions and 24 deletions

View File

@ -138,17 +138,31 @@
</xsl:template> </xsl:template>
<xsl:template name="process-content-item-detail"> <xsl:template name="process-content-item-detail">
<xsl:param name="contentitem-tree"/> <xsl:param name="contentitem-tree"/>
<xsl:param name="content-section" select="''"/> <xsl:param name="content-section" select="''"/>
<xsl:param name="mode" select="'detail'"/>
<xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/> <xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/>
<xsl:variable name="category" select="foundry:read-current-category()"/> <xsl:variable name="category" select="foundry:read-current-category()"/>
<xsl:variable name="content-type" select="$contentitem-tree/objectType"/> <xsl:variable name="content-type" select="$contentitem-tree/objectType"/>
<xsl:variable name="template-map"> <xsl:variable name="template-map">
<xsl:choose>
<xsl:when test="$mode = 'portlet-item'
and document(foundry:gen-path('conf/templates.xml'))/templates/content-items/portlet-item">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/portlet-item/*"/>
</xsl:when>
<xsl:when test="$mode = 'greeting-item'
and document(foundry:gen-path('conf/templates.xml'))/templates/content-items/greeting-item">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/greeting-item/*"/>
</xsl:when>
<xsl:when test="$mode = 'detail'">
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/detail/*"/> <xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/detail/*"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/detail/*"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>

View File

@ -172,12 +172,23 @@
<xsl:value-of select="$type"/> <xsl:value-of select="$type"/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:choose>
<xsl:when test="string-length($title) &gt; 0">
<xsl:attribute name="title" select="$title"/>
</xsl:when>
<xsl:when test="./@title">
<xsl:attribute name="title" select="./title"/>
</xsl:when>
<xsl:when test="./@title-static">
<xsl:attribute name="title"
select="foundry:get-static-text('', ./@title-static)"/>
</xsl:when>
</xsl:choose>
<xsl:call-template name="foundry:process-layouttree-attributes"> <xsl:call-template name="foundry:process-layouttree-attributes">
<xsl:with-param name="id" select="$id"/> <xsl:with-param name="id" select="$id"/>
<xsl:with-param name="class" select="$class"/> <xsl:with-param name="class" select="$class"/>
<xsl:with-param name="copy-attributes" <xsl:with-param name="copy-attributes"
select="'download rel type'"/> select="'download rel type'"/>
<xsl:with-param name="title" select="$title"/>
</xsl:call-template> </xsl:call-template>
<xsl:apply-templates/> <xsl:apply-templates/>
</a> </a>

View File

@ -32,6 +32,7 @@
<xsl:with-param name="contentitem-tree"> <xsl:with-param name="contentitem-tree">
<xsl:copy-of select="$portlet-data-tree/portlet:contentItem/cms:item/*"/> <xsl:copy-of select="$portlet-data-tree/portlet:contentItem/cms:item/*"/>
</xsl:with-param> </xsl:with-param>
<xsl:with-param name="mode" select="'portlet-item'"/>
</xsl:call-template> </xsl:call-template>
</xsl:template> </xsl:template>