[opencms-dev] cms:vfs get content of page element

Yves Glodt yg at mind.lu
Fri Jul 24 19:29:40 CEST 2009


Hi Achim,

I tried it but in my (probably special) case it did not work. I just get 
no more content rendered as soon as I add the c:set

What I actually do is:

I have page.html, in which (coded in the template), I include page.jsp.

Inside page.jsp I use a tag from my taglib, and I would like to give the 
tag the content of an element of page.html as attribute, to be able to 
add it somewhere inside the tag. That's why I was using thinking the 
cms:vfs would help me

Best regards,
Yves

p.s.
Does someone know how to pass an array of strings to a tag-attribute, 
e.g. specifying :
<jsp:attribute name="myname">Content 1</jsp:attribute>
<jsp:attribute name="myname">Content 2</jsp:attribute>
<jsp:attribute name="myname">Content 3</jsp:attribute>

Defining String[] as type in the .tld file unsurprisingly does not work...

On Friday 24 July 2009, a.westermann at alkacon.com wrote:
> Hi Yves,
>
> I'd try
>
> <c:set var="myvar"><cms:include file="" element="/en/op/start.html"
> element="content"/></c:set>
>
> Then you could use:
>
> ${myvar}
>
> somewhere else.
>
> Kind Regards,
> Achim.
>
> -------------------
> Achim Westermann
>
> Alkacon Software GmbH  - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
>
> Yves Glodt wrote:
> > Hello,
> >
> > is there a way usiing the powerful cms:vfs to get the content of a
> > page element?
> >
> > Somehow like (guessing, this does not work):
> > ${cms:vfs(pageContext).readResource['/en/op/start.html'].contents}
> > or
> > ${cms:vfs(pageContext).readXml['/en/op/start.html'].value("content"
> >)}
> >
> >
> > I need to get the html of a page element to pass it to a taglib...
> >
> > Best regards,
> > Yves



More information about the opencms-dev mailing list