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:copy-of select="document(foundry:gen-path('conf/templates.xml'))/templates/content-items/detail/*"/> <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: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>
@ -656,32 +670,32 @@
</p> </p>
<pre> <pre>
/* Sets the reference point for position: absolute /* Sets the reference point for position: absolute
to the main element block */ to the main element block */
main { main {
position: relative; position: relative;
} }
/* Don't show the edit link on a first glance */ /* Don't show the edit link on a first glance */
main .edit-link { main .edit-link {
display: none; display: none;
} }
/* Display the edit link in the top right corner /* Display the edit link in the top right corner
of the content item area if the cursor is in of the content item area if the cursor is in
the content item area */ the content item area */
main:hover .edit-link { main:hover .edit-link {
display: block; display: block;
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
font-size: 30px; font-size: 30px;
color: #0776a0; color: #0776a0;
/* Blue border around the link */ /* Blue border around the link */
border: 1px solid #0776a0; border: 1px solid #0776a0;
/* Make the link 32px in width and height */ /* Make the link 32px in width and height */
width: 32px; width: 32px;
height: 32px; height: 32px;
text-align: center; text-align: center;
} }
/* Remove default decoration for links */ /* Remove default decoration for links */
@ -689,8 +703,8 @@
main:hover .edit-link a:hover, main:hover .edit-link a:hover,
main:hover .edit-link a:active, main:hover .edit-link a:active,
main:hover .edit-link a:visited { main:hover .edit-link a:visited {
color: #0776a0; color: #0776a0;
text-decoration: none; text-decoration: none;
} }
</pre> </pre>

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>