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 name="process-content-item-detail">
<xsl:param name="contentitem-tree"/>
<xsl:param name="content-section" select="''"/>
<xsl:param name="mode" select="'detail'"/>
<xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/>
<xsl:variable name="category" select="foundry:read-current-category()"/>
<xsl:variable name="content-type" select="$contentitem-tree/objectType"/>
<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:choose>
@ -656,32 +670,32 @@
</p>
<pre>
/* Sets the reference point for position: absolute
to the main element block */
to the main element block */
main {
position: relative;
position: relative;
}
/* Don't show the edit link on a first glance */
main .edit-link {
display: none;
display: none;
}
/* Display the edit link in the top right corner
of the content item area if the cursor is in
the content item area */
of the content item area if the cursor is in
the content item area */
main:hover .edit-link {
display: block;
position: absolute;
right: 0;
top: 0;
font-size: 30px;
color: #0776a0;
/* Blue border around the link */
border: 1px solid #0776a0;
/* Make the link 32px in width and height */
width: 32px;
height: 32px;
text-align: center;
display: block;
position: absolute;
right: 0;
top: 0;
font-size: 30px;
color: #0776a0;
/* Blue border around the link */
border: 1px solid #0776a0;
/* Make the link 32px in width and height */
width: 32px;
height: 32px;
text-align: center;
}
/* Remove default decoration for links */
@ -689,8 +703,8 @@
main:hover .edit-link a:hover,
main:hover .edit-link a:active,
main:hover .edit-link a:visited {
color: #0776a0;
text-decoration: none;
color: #0776a0;
text-decoration: none;
}
</pre>

View File

@ -172,12 +172,23 @@
<xsl:value-of select="$type"/>
</xsl:attribute>
</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:with-param name="id" select="$id"/>
<xsl:with-param name="class" select="$class"/>
<xsl:with-param name="copy-attributes"
select="'download rel type'"/>
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<xsl:apply-templates/>
</a>

View File

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