You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2006/03/14 10:28:23 UTC
svn commit: r385771 -
/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-authors.ft
Author: thorsten
Date: Tue Mar 14 01:28:21 2006
New Revision: 385771
URL: http://svn.apache.org/viewcvs?rev=385771&view=rev
Log:
FOR-797 updating contract
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-authors.ft
Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-authors.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-authors.ft?rev=385771&r1=385770&r2=385771&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-authors.ft (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.themes.core/themes/common/html/content-authors.ft Tue Mar 14 01:28:21 2006
@@ -15,46 +15,46 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<forrest:contract
+<forrest:contract name="content-authors"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
- xmlns:forrest="http://apache.org/forrest/templates/1.0"
- name="content-authors" type="nugget">
+ xmlns:forrest="http://apache.org/forrest/templates/1.0">
<description>
content-authors will output the authors of the content.
</description>
- <usage><![CDATA[<forrest:contract name="content-authors">
- <forrest:properties contract="content-authors">
- <forrest:property name="content-authors" nugget="get.authors">
- <jx:import uri="cocoon://#{$cocoon/parameters/getRequest}.authors.xml"/>
- </forrest:property>
- </forrest:properties>
-</forrest:contract>]]></usage>
+ <usage><![CDATA[<forrest:contract name="content-authors"
+ dataURI="cocoon://#{$getRequest}.authors.xml"/>]]></usage>
<forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
- format="html" name="content-authors" inputFormat="xsl" body="true" head="false">
+ name="content-authors" inputFormat="xsl">
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template name="content-authors-body">
- <xsl:param name="content-authors"/>
- <xsl:comment>+ |start content-authors +</xsl:comment>
- <!--<xsl:copy-of
- select="$content-authors/div[@id='content-authors']"/>-->
- <xsl:call-template name="content-author-processing">
- <xsl:with-param name="authors"
- select="$content-authors/div[@id='content-authors']"/>
- </xsl:call-template>
- <xsl:comment>+ |end content-authors +</xsl:comment>
+ <xsl:template match="/">
+ <forrest:content>
+ <forrest:part>
+ <xsl:comment>+ |start content-authors +</xsl:comment>
+ <xsl:call-template name="content-author-processing">
+ <xsl:with-param name="authors"
+ select="div[@id='content-authors']"/>
+ </xsl:call-template>
+ <xsl:comment>+ |end content-authors +</xsl:comment>
+ </forrest:part>
+ </forrest:content>
</xsl:template>
<xsl:template name="content-author-processing">
<xsl:param name="authors"/>
- <xsl:for-each select="$authors/div[@class='author']">
- <xsl:choose>
- <xsl:when test="position()=1">by</xsl:when>
- <xsl:otherwise>,</xsl:otherwise>
- </xsl:choose>
- <xsl:text> </xsl:text>
- <span class="name">
- <xsl:value-of select="./div[@class='name']/text()"/>
- </span>
- </xsl:for-each>
+ <xsl:if test="$authors/div[@class='author']">
+ <p>
+ <xsl:for-each select="$authors/div[@class='author']">
+ <xsl:choose>
+ <xsl:when test="position()=1">by</xsl:when>
+ <xsl:otherwise>,</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>
+ </xsl:text>
+ <span class="name">
+ <xsl:value-of select="./div[@class='name']/text()"/>
+ </span>
+ </xsl:for-each>
+ </p>
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
</forrest:template>