[opencms-dev] include xmlpage content from template

Paul-Inge Flakstad flakstad at npolar.no
Fri Feb 12 12:48:37 CET 2010


Hi Yogesh,

As described in the documentation, it should be sufficient just add editable="true" to your include:

<cms:editable />
...
<cms:include file="/site/path/to/tip-file.html" element="body" editable="true" />

or its scriptlet equivalent (I just copied this code from the OpenCms documentation).

-Paul

________________________________
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Yogesh Mujumdar
Sent: 12. februar 2010 12:40
To: The OpenCms mailing list
Subject: Re: [opencms-dev] include xmlpage content from template

Thanks Paul.

Any way to make the tip direct editable? In my template if I add <cms:editable/> in head and set editable="true" to the included element from my elements jsp, the template itself opens up for editing. I would like to edit the tip file from the page. This would ease the process of adding tips.

-- Yogesh

Believe with all your heart that how you live your life makes a difference. --Colin Beavan


On Fri, Feb 12, 2010 at 4:21 PM, Paul-Inge Flakstad <flakstad at npolar.no<mailto:flakstad at npolar.no>> wrote:
Hi again Yogesh

This is equivalent to the suggestion I sent just as this message was arriving in my inbox.

Great that you got it working, grats! ;-)

Cheers,
Paul

________________________________
From: opencms-dev-bounces at opencms.org<mailto:opencms-dev-bounces at opencms.org> [mailto:opencms-dev-bounces at opencms.org<mailto:opencms-dev-bounces at opencms.org>] On Behalf Of Yogesh Mujumdar
Sent: 12. februar 2010 11:44

To: The OpenCms mailing list
Subject: Re: [opencms-dev] include xmlpage content from template

Done!, its working now. This is what I did.

In the elements file : cms.include(tfilename, "body");

and changed the tip_file property from /sites/default/TAIG/personal/MyTip1.html to /TAIG/personal/MyTip1.html

Thanks everybody.

-- Yogesh

Believe with all your heart that how you live your life makes a difference. --Colin Beavan


On Fri, Feb 12, 2010 at 3:32 PM, Yogesh Mujumdar <yogesh.mujumdar at gmail.com<mailto:yogesh.mujumdar at gmail.com>> wrote:
Hi Eska,

That did not work.

I get the error

    javax.servlet.jsp.JspException: Error reading resource from path "/sites/default/TAIG/personal/MyTip1.html".

I changed the element file code to :
<cms:template element="insider_tip">
       <%
            CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
            String tfilename = cms.property("tip_file");
            cms.include(tfilename);
       %>
</cms:template>



-- Yogesh

Believe with all your heart that how you live your life makes a difference. --Colin Beavan


On Fri, Feb 12, 2010 at 3:21 PM, Eska <sven.kiesow at interone.de<mailto:sven.kiesow at interone.de>> wrote:

Hi Yogesh,

It seems you set the tip_file property in a wrong way. Do not set it to

/opencms/opencms/test/mytip.html

but to something like

/sites/abc/test/mytip.html

Eska


yogiam wrote:
>
> 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
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>

--
View this message in context: http://old.nabble.com/include-xmlpage-content-from-template-tp27560296p27561060.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.


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




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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100212/9fe1223c/attachment.htm>


More information about the opencms-dev mailing list