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

Jonathan Woods jonathan.woods at scintillance.com
Sat Jul 25 16:41:51 CEST 2009


Indeed - great idea.  And then you have the full power of the IDE at your
disposal, and you can abstract things to any level you like to end up with
nice clear page mark-up.

I must say I think that trying to do much programming in tags is an
anti-pattern.  Though most of the rest of the world seems to disagree, I
find it baffling that people so willingly give up a language they know, and
full-blown IDE support for code-time type checking and javadoc, to turn the
clock back and program in an ugly, syntactically inelegant, inefficient
language.  There are usually two unconvincing arguments put forward: first
that Java is programming and therefore inaccessible to user interface
developers, and second that using Java directly somehow encourages people to
introduce non-view logic into the view layer.  The first argument is daft -
using JSP tags is equally a form of programming - and the second argument
irrelevant to the experienced programmer.

Oops - off-topic rant over.

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Yves Glodt
> Sent: 24 July 2009 18:32
> To: The OpenCms mailing list
> Subject: Re: [opencms-dev] cms:vfs get content of page element
> 
> On Friday 24 July 2009, Jonathan Woods wrote:
> > And (maybe stating the obvious) don't forget you can always cut out 
> > the middle man and dive straight into <% java %> if the  
> JSP API isn't 
> > clear.  I felt very liberated when I lost all shame about 
> doing that!
> 
> That sounds interesting...
> 
> As I mentioned before I use a homebuilt tag in my jsp pages, 
> and I could use the opencms-api from within my taglib... :-) 
> 
> > > -----Original Message-----
> > > From: opencms-dev-bounces at opencms.org 
> > > [mailto:opencms-dev-bounces at opencms.org] On Behalf Of 
> > > a.westermann at alkacon.com
> > > Sent: 24 July 2009 14:29
> > > To: The OpenCms mailing list
> > > Subject: Re: [opencms-dev] cms:vfs get content of page element
> > >
> > > 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
> > > >
> > > > _______________________________________________
> > > > This mail is sent to you from the opencms-dev mailing list
> > >
> > > To change
> 
> _______________________________________________
> 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




More information about the opencms-dev mailing list