forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r279238 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2: resources/views/default.fv templates/content-title.ft
Date Wed, 07 Sep 2005 04:09:43 GMT
Author: rgardler
Date: Tue Sep  6 21:09:19 2005
New Revision: 279238

URL: http://svn.apache.org/viewcvs?rev=279238&view=rev
Log:
add title contract

Added:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/templates/content-title.ft
Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/resources/views/default.fv

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/resources/views/default.fv
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/resources/views/default.fv?rev=279238&r1=279237&r2=279238&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/resources/views/default.fv
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/resources/views/default.fv
Tue Sep  6 21:09:19 2005
@@ -56,7 +56,7 @@
                 -->
                 
                 <forrest:hook name="content">
-                   <!-- <forrest:contract name="content-title"/> -->
+                   <forrest:contract name="content-title"/>
                    <!-- <forrest:contract name="content-abstract"/> -->
                    <!--  <forrest:contract name="content-minitoc"/> -->
                     <forrest:contract name="content-main"/>

Added: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/templates/content-title.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/templates/content-title.ft?rev=279238&view=auto
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/templates/content-title.ft
(added)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.xhtml2/templates/content-title.ft
Tue Sep  6 21:09:19 2005
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<forrest:contract 
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  name="content-title" type="nugget">
+  <description>
+    content-title - Template will output the title (first h1 of the content). 
+  </description>
+  <usage><![CDATA[<forrest:contract name="content-title"/>]]></usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    format="xhtml" name="content-title" inputFormat="xsl" body="true" head="false">
+     <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	    <xsl:template name="content-title-body" match="div[@id='content']/h1[position()=1]">
+	<xsl:comment>+
+	    |start content-title
+	    +</xsl:comment>
+			  <xsl:copy-of select="div[@id='content']/h1[position()=1]"/>
+<xsl:comment>+
+    |end content-title
+    +</xsl:comment>
+		  </xsl:template>
+	  </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>
\ No newline at end of file



Mime
View raw message