[opencms-dev] Multiple content areas in a page

Mithun P R MithunP at ibsplc.com
Mon May 17 10:38:01 CEST 2004


Mark,
        i am trying to develop a intranet web site but i am facing some 
problem. i want to manage different content areas inside a single page, 
this means that a single page contains seperate editable areas. I have 
gone throught the discussion forum and found some data releating to this 
from Alexander

http://mail.opencms.org/pipermail/opencms-dev/2003q2/005734.html

in this solution first a file named "edit_options" must be edited. But i 
cant find that file in my /system/workplace/templates/edit_options
if you or anyone else knows where i can find this file or if there is any 
other method for what i am facing, please inform me at the earliest. I am 
really in a tight spot 'coz of the time limit.

So if anyone can help me it would be great.

Best regards
Mithun

-------------------------------------------------------------------------
PS: I am attaching the document by Alexander along with this.
-------------------------------------------------------------------------

guide on how to enable multiple content areas in the OpenCms WYSIWYGE 
editor with JSP templates:

1. In the OpenCms Workplace, open (in the txt editor) the file

/system/workplace/templates/edit_options

There are a couple of boolean values set. 
Change the line with BODYSELECTOR to:

var USE_BODYSELECTOR = true;

Save, exit and publish this file. 
If you now open any "Page" file in an editor, you should 
see a select box "Body:" beside the "Template:" selector.
The body should be "(default)" for all of your pages.
Obviously, the default body is the "normal" body that
is usually edited. 

2. Next you need to add bodies in your template. There a a couple
of ways to do this. There is even an option to enable in 
the user interface that can be activated in the edit_options,
but the behaviour is pretty strange so I do not recommend using this
feature. Also, you must make sure your templates always have the 
body parts in question (naming is important) so adding new 
bodies manually in the editor is not a good idea anyway. 

To get templates with more then the default body,
go to the "default_bodies" directory of any module, e.g.
the default module. In the default module,
there is a file "empty" in "default_bodies" with the 
title "Empty body". Copy this 
file, e.g. to a file "mybody" and change the title to
"My body file". Then change the content to something like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<XMLTEMPLATE>
    <TEMPLATE><![CDATA[ ]]></TEMPLATE>
    <edittemplate><![CDATA[ ]]></edittemplate>
    <template name="body2"><![CDATA[ ]]></template>
    <edittemplate name="body2"><![CDATA[ ]]></edittemplate>
    <template name="body3"><![CDATA[ ]]></template>
    <edittemplate name="body3"><![CDATA[ ]]></edittemplate>
    <template name="body4"><![CDATA[ ]]></template>
    <edittemplate name="body4"><![CDATA[ ]]></edittemplate>
    <template name="body5"><![CDATA[ ]]></template>
    <edittemplate name="body5"><![CDATA[ ]]></edittemplate>
    <template name="body6"><![CDATA[ ]]></template>
    <edittemplate name="body6"><![CDATA[ ]]></edittemplate>
    <template name="body7"><![CDATA[ ]]></template>
    <edittemplate name="body7"><![CDATA[ ]]></edittemplate> 
    <template name="body8"><![CDATA[ ]]></template>
    <edittemplate name="body8"><![CDATA[ ]]></edittemplate>
    <template name="body9"><![CDATA[ ]]></template>
    <edittemplate name="body9"><![CDATA[ ]]></edittemplate>

</XMLTEMPLATE>

3. Now create a new "Page" as usual with the "Wizard" symbol. 
In the "Create new page" dialog there is an option 
"Copy body from". This should now list your "My body file"
as well. Select this as the body file for your page.

Open the page in the editor. The "Body:" selector should now have
the "(default)" and also "body2" to "body9" available. 
You can now edit each of the bodies separatly. 

Note: As you can probably guess the naming of the bodies is 
up to you, so instead of "body2" you can use some name like
"header_text", "foot_text" or whatever. 

4. Now the only thing to do is make use of the additional bodies 
in your templates. 

Usually, you use something like 

<cms:include element="body" />

to include the body element. 
To include e.g. "body2" use:

<cms:include element="body2" />

This should be about it. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20040517/2ff507ba/attachment.htm>


More information about the opencms-dev mailing list