<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="urn:schemas-microsoft-com:office:smarttags">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.E-postmall17
        {mso-style-type:personal;
        font-family:Arial;
        color:windowtext;}
span.E-postmall19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Jon,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks for your email. Your solutions
works, I have tried that already earlier, but I was actually trying to do this
a bit different, sorry if I haven’t described clearly what I would like
to do. Let me try it again:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I want to have a number of “blocks”
in my navigation panel. Each block thereby is defined in a page which can be
edited with the HTML editor. Since I want editors to edit the content of the
blocks, I would like to place these block.html files in the explorer view
/sites/default. These problems occurred when trying to do that: first of all, I
couldn’t include any HTML files from within the template, only .jsp files
worked. Furthermore, these jsp files have to reside within /system/modules/[my
module]/.. , I could not manage to link from within a template to a file at
/sites/default/[my site]. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>With the solution I have (and with the one
you have mentioned), editors of the content of these “blocks” would
have to edit in the within /system/modules/[my module]/.. view and could NOT
use the HTML editor, since the page has to be a jsp. Is that right? Or am I
doing a stupid newbie mistake ( I am quite new to openCMS)?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks a lot,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Felix<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=SV style='font-size:12.0pt'>

<hr size=3 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=SV style='font-size:
10.0pt;font-family:Tahoma;font-weight:bold'>Från:</span></font></b><font
size=2 face=Tahoma><span lang=SV style='font-size:10.0pt;font-family:Tahoma'>
opencms-dev-bounces@opencms.org [mailto:opencms-dev-bounces@opencms.org] <b><span
style='font-weight:bold'>För </span></b>Jonathan Woods<br>
<b><span style='font-weight:bold'>Skickat:</span></b> den 4 oktober 2006 12:14<br>
<b><span style='font-weight:bold'>Till:</span></b> 'The OpenCms mailing list'<br>
<b><span style='font-weight:bold'>Ämne:</span></b> RE: [opencms-dev] include
html files from templates</span></font><span lang=SV><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>This is how I do something like what
you're asking about.  Lots of steps, so bear with me while I explain....</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Create [my-page] as 'New / Page with
free text'.  In the dialogue which appears, choose as the new file's
template a JSP file which you've already created and placed in your
module's 'templates' folder.  This JSP file is what OpenCms will execute
when the URL for [my-page] is invoked.  You can populate the starting
content of [my-page] by choosing a file in the 'Copy body from' drop down; the
files which appear there are taken from your module's default_bodies folder.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>As for the JSP, you want it to do what
you've outlined: contain some code (may included from a JSP snippet elsewhere)
which renders menus, and also bring in the content from [my-page].  Here's
some JSP code which does just that for me:</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p><font size=2 color="#bf5f3f" face="Lucida Console"><span style='font-size:
10.0pt;font-family:"Lucida Console";color:#BF5F3F'><%@ </span></font><font
size=2 color="#3f7f7f" face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:#3F7F7F'>page </span></font><font size=2
color="#7f007f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#7F007F'>pageEncoding</span></font><font size=2
color=black face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:black'>=</span></font><font size=2 color="#2a00ff"
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:#2A00FF'>"UTF-8" </span></font><font size=2 color="#7f007f"
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:#7F007F'>session</span></font><font size=2 color=black
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:black'>=</span></font><font size=2 color="#2a00ff" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#2A00FF'>"false"
</span></font><font size=2 color="#7f007f" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#7F007F'>import</span></font><font
size=2 color=black face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:black'>=</span></font><font size=2
color="#2a00ff" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#2A00FF'>"all your imports here" </span></font><font
size=2 color="#bf5f3f" face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:#BF5F3F'>%><br>
<%@ </span></font><font size=2 color="#3f7f7f" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#3F7F7F'>taglib </span></font><font
size=2 color="#7f007f" face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:#7F007F'>prefix</span></font><font size=2
color=black face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:black'>=</span></font><font size=2 color="#2a00ff"
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:#2A00FF'>"cms" </span></font><font size=2 color="#7f007f"
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:#7F007F'>uri</span></font><font size=2 color=black face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:black'>=</span></font><font
size=2 color="#2a00ff" face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:#2A00FF'>"http://www.opencms.org/taglib/cms"
</span></font><font size=2 color="#bf5f3f" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#BF5F3F'>%></span></font><font
size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:blue'><o:p></o:p></span></font></p>

<p><font size=2 color=teal face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:teal'><</span></font><font size=2
color="#3f7f7f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#3F7F7F'>cms:include </span></font><font size=2
color="#7f007f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#7F007F'>file</span></font><font size=2 color=black
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:black'>=</span></font><font size=2 color="#2a00ff" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#2A00FF'>"../elements/pagecontentopen.jsp"</span></font><font
size=2 color=teal face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:teal'>/></span></font><font size=2
color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:blue'><o:p></o:p></span></font></p>

<p><font size=2 color=teal face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:teal'><</span></font><font size=2
color="#3f7f7f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#3F7F7F'>div </span></font><font size=2 color="#7f007f"
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:#7F007F'>class</span></font><font size=2 color=black face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:black'>=</span></font><font
size=2 color="#2a00ff" face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:#2A00FF'>"freeformContent"</span></font><font
size=2 color=teal face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:teal'>><</span></font><font size=2
color="#3f7f7f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#3F7F7F'>cms:include </span></font><font size=2
color="#7f007f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#7F007F'>element</span></font><font size=2 color=black
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:black'>=</span></font><font size=2 color="#2a00ff" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#2A00FF'>"body"</span></font><font
size=2 color=teal face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:teal'>/></</span></font><font size=2
color="#3f7f7f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#3F7F7F'>div</span></font><font size=2 color=teal
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:teal'>></span></font><font size=2 color=blue face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:blue'><o:p></o:p></span></font></p>

<p><font size=2 color=teal face="Lucida Console"><span style='font-size:10.0pt;
font-family:"Lucida Console";color:teal'><</span></font><font size=2
color="#3f7f7f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#3F7F7F'>cms:include </span></font><font size=2
color="#7f007f" face="Lucida Console"><span style='font-size:10.0pt;font-family:
"Lucida Console";color:#7F007F'>file</span></font><font size=2 color=black
face="Lucida Console"><span style='font-size:10.0pt;font-family:"Lucida Console";
color:black'>=</span></font><font size=2 color="#2a00ff" face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:#2A00FF'>"../elements/pagecontentclose.jsp"
</span></font><font size=2 color=teal face="Lucida Console"><span
style='font-size:10.0pt;font-family:"Lucida Console";color:teal'>/></span></font><font
size=1 color=teal face="Lucida Console"><span style='font-size:7.5pt;
font-family:"Lucida Console";color:teal'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>The included JSP paths are relative to the
path of the JSP in which this code appears, so you'll need an elements
directory in your module which contains the cited resources.  In my case,
these JSPs top and tail page content; the top (pagecontentopen.jsp) renders the
HTML preamble and page header and top/left navigation; the tail
(pagecontentclose.jsp) renders the page footer and HTML closure.  The
<cms:include> tag in the middle is confusingly similar, but in this case
the code means 'include the XML element named 'body' from the file referred to
by the URL which caused me [this JSP] to be invoked'.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>I've mentioned modules a few times. 
To create a module of your own, create a folder named <your module name>
in /system/modules, and create JSPs etc in folders underneath that.</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=blue face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:blue'>Jon</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> <o:p></o:p></span></font></p>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=3 width="100%" align=center tabIndex=-1>

</span></font></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Felix Sprick<br>
<b><span style='font-weight:bold'>Sent:</span></b> 04 October 2006 10:27<br>
<b><span style='font-weight:bold'>To:</span></b> opencms-dev@opencms.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> [opencms-dev] include
html files from templates</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hi all,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I have a question concerning includes in templates. What I
like to do: I want to have a “navigation panel” that consists of
several blocks with images and text (basically HTML blocks). I want this panel
included in every of my pages, that’s why I would like the entire panel
from my template on which the pages are built. My question: how do I include
the blocks (HTML pages that can be edited with WYSIWYG editor) from
/sites/default/[my-page] inside my template?? Everything I tried ended up in a
file not found exception.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Does anyone know if that’s possible or know how to do
it?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Your help is highly appreciated!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Felix </span></font><font size=2 face=Verdana><span
style='font-size:10.0pt;font-family:Verdana'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>