synyx GmbH & Co. KG Homepage Welcome Guest   | Login
  Search  
  Index  | Recent Threads  | Who's Online  | User List  | Register  | Search  | Help  | RSS feeds


Quick Go »
Thread Status: Normal
Total posts in this thread: 2
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 2108 times and has 1 reply Next Thread
Male marquex
Stranger



Joined: Apr 17, 2009
Posts: 2
Status: Offline

cms:include element=body default page??

Hi,

I read the docs for the cms:include tag, and there is a section in it which says:

Body:

You can use scriptlet code to determine the included filename in the body if none of the attributes page/ file, property or attribute is used.

You can add additional key/value coded parameters to the request parameters hashtable to pass them to the included file, e.g. <cms:param name="myparam" value="myvalue" />.


I really would like to determine the filename in the body, but there is no place where that's explained.

Somebody has an idea???
[Aug 12, 2009 12:27:44 PM] Show Printable Version of Post        Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male ocamus
Stranger



Joined: Jan 7, 2008
Posts: 11
Status: Offline

Re: cms:include element=body default page??

here is a piece of template code :


<%@ page import="java.util.*,org.opencms.file.*,org.opencms.jsp.*"
buffer="none" session="false"%>
<%
// create a JSP action element
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);

// get own uri = filename of the called document
// even if you are in the template jsp
String uri = cms.getRequestContext().getUri();

%>

....

<%
// display the "body" element of your xmlpage
cms.include(uri, "body");
%>

[Sep 11, 2010 10:23:12 AM] Show Printable Version of Post     [Link] Report threatening or abusive post: please login first  Go to top 
[Show Printable Version of Thread]