<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>question about template problem</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2>A followup to this problem. If I use JSPs instead of HTMLs
for the included pages, then I do not have the problem and I see the
expected</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2>Include File 1</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2>This is some text</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2>Include File 2</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2>Looking in opencms.log, for the HTML version I
see</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=265303419-29092004><FONT face=Arial
color=#0000ff size=2>[29.09.2004 15:40:28] <opencms_elementcache>
[CmsElementXml (CmsXmlTemplate/inc1.html)] Varia<BR>nt
"key_http_body._TEMPLATESELECTOR_=default;body._TEMPLATE_=/system/bodies/gto/inc1.html;bod<BR>y._CLASS_=com.opencms.template.CmsXmlTemplate;"
is not in element cache. <BR>[29.09.2004 15:40:28] <opencms_elementcache>
[CmsElementXml (CmsXmlTemplate/inc1.html)] addin<BR>g variant
"key_http_body._TEMPLATESELECTOR_=default;body._TEMPLATE_=/system/bodies/gto/inc1.h<BR>tml;body._CLASS_=com.opencms.template.CmsXmlTemplate;"
to cache. <BR>[29.09.2004 15:40:28] <opencms_elementcache> [CmsElementXml
(CmsXmlTemplate/bodyloader)] gett<BR>ing variant "key_http_" from cache.
<BR>[29.09.2004 15:40:28] <opencms_elementcache> [CmsElementXml
(CmsXmlTemplate/inc1.html)] getti<BR>ng variant
"key_http_body._TEMPLATESELECTOR_=default;body._TEMPLATE_=/system/bodies/gto/inc1.<BR>html;body._CLASS_=com.opencms.template.CmsXmlTemplate;"
from cache. </FONT></SPAN></DIV>
<DIV><SPAN class=265303419-29092004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=265303419-29092004><FONT face=Arial color=#0000ff size=2>The
inc1.html file is added twice into the file. I think maybe this is because
body._TEMPLATE_ is not being reset to the body of the templated file between
<cms:include page=""/> and <cms:include element="body"/>. What I am
wondering now, if anyone familiar with the internals of OpenCms knows - how can
I reset the context of the include tag from the included inc1.html to the
templated page?</DIV>
<DIV dir=ltr align=left><BR></DIV></FONT></SPAN><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Andy
Kriger<BR><B>Sent:</B> Wednesday, September 29, 2004 12:41 PM<BR><B>To:</B> 'The
OpenCms mailing list'<BR><B>Subject:</B> [opencms-dev] question about template
problem<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>In this template...</FONT> </P>
<P><FONT face=Arial size=2><%@ page contentType="text/html" language="java"
pageEncoding="UTF-8" %></FONT> <BR><FONT face=Arial size=2><%@ taglib
prefix="cms" uri="<A
href="http://www.opencms.org/taglib/cms">http://www.opencms.org/taglib/cms</A>"
%></FONT> <BR><FONT face=Arial
size=2><html><head></head><body></FONT> <BR><FONT
face=Arial size=2><cms:include page="/gto/inc1.html"/><br></FONT>
<BR><FONT face=Arial size=2><br></FONT> <BR><FONT face=Arial
size=2><cms:include element="body"/><br></FONT> <BR><FONT face=Arial
size=2><br></FONT> <BR><FONT face=Arial size=2><cms:include
page="/gto/inc2.html"/><br></FONT> <BR><FONT face=Arial
size=2><br></FONT> <BR><FONT face=Arial
size=2></body></html></FONT> </P>
<P><FONT face=Arial size=2>/gto/inc1.html and /gto/inc2.html are files in the
same directory as the page that is using this template, containing the text
"Include File 1" or "Include File 2". The page using the template has a body of
"This is some text". </FONT></P>
<P><FONT face=Arial size=2>Viewing the page using the template, I would expect
to see</FONT> <BR><FONT face=Arial size=2>Include File 1</FONT> <BR><FONT
face=Arial size=2>This is some text</FONT> <BR><FONT face=Arial size=2>Include
File 2</FONT> </P>
<P><FONT face=Arial size=2>When I view this page, I see</FONT> <BR><FONT
face=Arial size=2>Include File 1</FONT> <BR><FONT face=Arial size=2>Include File
1</FONT> <BR><FONT face=Arial size=2>Include File 2</FONT> </P>
<P><FONT face=Arial size=2>If I move the <cms:include element="body"/> tag
before the first include, then I see</FONT> <BR><FONT face=Arial size=2>This is
some text</FONT> <BR><FONT face=Arial size=2>Include File 1</FONT> <BR><FONT
face=Arial size=2>Include File 2</FONT> </P>
<P><FONT face=Arial size=2>So the body text of the page is definitely able to be
found but the order of include tags seems to affect things. Can anyone tell me
why the inc1.html is being duplicated? And how I might workaround this
problem?</FONT></P></BODY></HTML>