[opencms-dev] Multiple Content Areas

Alexander Kandzior alex at opencms.org
Mon Jul 28 12:47:01 CEST 2003


Jens,

you might try the following:

<%
String target = "/uri/of/the/page/file";
String element = "name_of_element";
com.opencms.file.CmsObject cms; // init this e.g. with
CmsJspActionElement.getCmsObject()

com.opencms.template.CmsXmlTemplate template = new
com.opencms.template.CmsXmlTemplate();
byte[] res = template.getContent(cms, target, element, null);
String result = new String(res, cms.getRequestContext().getEncoding());
// now check content of result to see if it is empty "" or not
%>

I didn't try this myself so I am not 100% if it works or not. If it
dosen't, try around with this and have a look at the source of
CmsJspActionElement method "public String getContent(String target)".

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com

> -----Original Message-----
> From: opencms-dev-admin at opencms.org 
> [mailto:opencms-dev-admin at opencms.org] On Behalf Of Jens Rickhoff
> Sent: Monday, July 28, 2003 10:19 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] Multiple Content Areas
> 
> 
> Hi all,
> 
> I am using multiple content areas for selection in the 
> WYSIWYG editor as Alex described in 
> http://mail.opencms.org/pipermail/opencms-dev/2003q2/005734.ht
ml

Is there any way to check whether one content area is empty (i.e. the
content editor did not enter anything in that particular body)? The
return type of CmsJspActionElement.include(...) is void, so I can't
directly check it. Is there any way to retrieve the content of a content
area as, say, a String, where I could further process it in my JSP code?

Thanks for any hints,

Jens

_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please
visit http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list