<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<small><font face="Verdana">just to share my experience. hope this
helps.<br>
<br>
template property is like the global layout of pages within a site. I
use template to define (store) the header, navigation menu, sidebar,
the box to contain main content and the footer.<br>
<br>
this is the basic codes of a template</font></small><br>
<small><font face="Courier New"><font color="#000099">if
(cms.template("head")) {<br>
  ...<br>
} // end of head template<br>
<br>
if (cms.template("content")) {<br>
   ...<br>
}<br>
<br>
if (cms.template("foot")) {<br>
   ...<br>
}</font><br>
<br>
the template-element property is used to display the inner content.<br>
for a structured xml content, the default template-element property is
set in modules.xml<br>
</font><font face="Courier New"><property><br>
   <name>template-elements</name><br>
      <value
type="shared"><![CDATA[/system/modules/module-name/whateverfolder/detail_typename.jsp]]></value><br>
</property></font></small><br>
<br>
<small><font face="Verdana">the detail jsp looks like this</font></small><br>
<font color="#000099"><small><font face="Courier New"><cms:include
property="template" element="head" /><br>
<br>
<cms:contentload collector="singleFile"
param="${pageContext.detailfile}" editable="true"><br>
   ... show content stuff ...<br>
</cms:contentload><br>
<br>
<cms:include property="template" element="foot" /></font></small></font><br>
<br>
<small><font face="Verdana">for each structured content, I have one
detail jsp whose job is to display the specific content type. this
jsp's main job is playing (grab data from the outer type and the nested
type) with the fields in the xml content and then display them in
customized way. I use scriptlet instead of tablib to do this. more
flexible.<br>
<br>
for me, xmlpage doesnt need template-element property, just put content
in body element. the template jsp will make use of the body element
automatically. (thanks to templateOne)<br>
<br>
Joe</font></small><br>
<br>
<blockquote type="cite">
  <div class="moz-text-plain" wrap="true" graphical-quote="true"
 style="font-family: -moz-fixed; font-size: 13px;" lang="x-western">
  <pre wrap="">Thanks that helps.  So, does this replace the template property,
assuming I have a master template setup, or is it used in conjunction
with the template-elements?


-----Original Message-----
From: <a class="moz-txt-link-abbreviated"
 href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
[<a class="moz-txt-link-freetext"
 href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] On Behalf Of Jonathan Woods
Sent: Tuesday, September 05, 2006 10:45 PM
To: 'The OpenCms mailing list'
Subject: RE: [opencms-dev] template-element property

If you set the template-elements property on an XML resource to the path
of
a JSP (usually one held within a module), than page views of the URL
corresponding to the XML resource causes the JSP to be executed.
Typically,
this approach is used to render XML content using a JSP view.

When XML content types are defined in a module, it's common to have the
template-elements property set automatically on new instances of the
content
type.  Here's an example taken from my opencms-modules.xml:

                        <resourcetypes>
                                <type
class="org.opencms.file.types.CmsResourceTypeXmlContent" name="article"
id="80">
                                        <properties>
                                                <property>
                                                        <!-- Determines
behaviour of editor in outputting contents -->
        
<name>content-conversion</name>
                                                        <value
type="shared">
        
<![CDATA[cleanup;xhtml]]>
                                                        </value>
                                                </property>
                                                <property>
                                                        <!-- This
property is set to define the JSP used to render the resource. -->
        
<name>template-elements</name>
                                                        <value
type="shared">
        
<![CDATA[<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>system/modules<span
 class="moz-txt-tag">/</span></i>{{runtime.opencms.module.name}}/template-elemen
ts/a
rticle.jsp]]>
                                                        </value>
                                                </property>
                                        </properties>
                                        <copy-resources />
                                        <param
name="schema"><i class="moz-txt-slash"><span class="moz-txt-tag">/</span>system/modules<span
 class="moz-txt-tag">/</span></i>{{runtime.opencms.module.name}}/schemas/ar
ticl
e.xsd</param>
                                </type>
                                <!- ........ ->
                        </resourcetypes>

Jon

-----Original Message-----
From: <a class="moz-txt-link-abbreviated"
 href="mailto:opencms-dev-bounces@opencms.org">opencms-dev-bounces@opencms.org</a>
[<a class="moz-txt-link-freetext"
 href="mailto:opencms-dev-bounces@opencms.org">mailto:opencms-dev-bounces@opencms.org</a>] On Behalf Of Chris Tiernan
Sent: 06 September 2006 02:25
To: <a class="moz-txt-link-abbreviated"
 href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a>
Subject: [opencms-dev] template-element property

I'm a little confused by the template-element property.   Can anyone
provide a quick explanation of this property, how I can benefit from
using
it, and point me to a good example?  Thanks in advanced.

Best,
Chris


_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change
your
list options, or to unsubscribe from the list, please visit
<a class="moz-txt-link-freetext"
 href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>



_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit
<a class="moz-txt-link-freetext"
 href="http://lists.opencms.org/mailman/listinfo/opencms-dev">http://lists.opencms.org/mailman/listinfo/opencms-dev</a>
  </pre>
  </div>
</blockquote>
<br>
</body>
</html>