[opencms-dev] include xmlpage content from template

Paul-Inge Flakstad flakstad at npolar.no
Fri Feb 12 10:32:47 CET 2010


Hi Yogesh

Unless you want to use hard coded file names, using properties such a job sounds about right.

Can you paste the complete error message? Also, please inform what you set the property value to, and where the tip file is located.

I suspect that you will need to use a JSP file - typically the tip_file's template (which is usually found as the property template-elements) - to render the content of your tip file. You would then include this JSP file inside your template code, not the tip file itself. Note that I am not totally sure of this, as I rarely use the xmlpage myself.

Best regards,
Paul
________________________________
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Yogesh Mujumdar
Sent: 12. februar 2010 09:34
To: opencms-dev at opencms.org
Subject: [opencms-dev] include xmlpage content from template

Dear All,

I have a simple template which is supposed to show the page content. The template has a Tips section where I need to display tips. These requirement is that the tips have to be editable at page level. Tips will be HTML content(xmlpage).

The solution that I came across(which does not work) was to define a property called as tip_file for every page and specify a file name which needs to be shown as a tip. In the template I get the property(tip_file) of the page and make a URI to the file using the context uri and foldername and the tip filename. I then include this file in the template with include method of CmsJspActionElement object. When I view the file with tip_file property set to some xmlpage, I get and error which says "/opencms/opencms/test/mytip.html" is not accessible, though it is available in the folder and is accessible if viewed independently.

Any other quick and smart way of doing it?

-- Yogesh

Believe with all your heart that how you live your life makes a difference. --Colin Beavan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100212/aaf1f471/attachment.htm>


More information about the opencms-dev mailing list