[opencms-dev] Re: Include body content between sites

Thomas März thomas.maerz at gmail.com
Wed Apr 12 08:24:23 CEST 2006


"Noel Gelineau" <ngelineau at greenridge.ca> writes:

> Hum, I see what you mean, very unfortunate.  I was
> thinking of changing the site temporarily to root (/)
> within code, then do the include, then switch it back.  I
> can't even begin to come up with the code to do something
> like that (if it's possible), there must be an easier way.

I did not run the code, but it should work.

| CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
| String siteRoot = cms.getRequestContext().getSiteRoot();
| cms.getRequestContext().setSiteRoot("");
| cms.include("/sites/site1/test.html, "body");
| cms.getRequestContext().setSiteRoot(siteRoot);


Regards,
Thomas




More information about the opencms-dev mailing list