Re: Using Velocity templates as applied decorator panel content

Joe Walnes <[email protected]>
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <[email protected]>
Hi Wendel,

Out of the box, there is currently no support for Velocity decorators. 

However, if you really need it, it shouldn't be too hard to implement
yourself (and even contribute back) :). Basically, you need to could
write a macro that loads cart.vm into an String, passes the string to
HtmlPageParser (a SiteMesh class), which converts it to a Page object
(another SiteMesh class), then include your 'panel.vm' decorator,
passing the Page instance into it.

cheers
-Joe





On Tue, 29 Mar 2005 18:10:50 CST, Wendel Schultz
<[email protected]> wrote:
> I'm one week old in Struts, Velocity and Sitemesh.  Please be gentle.
> 
> I'm coming along ok I suppose.  I can get struts actions to find a velocity template.  I can use that template to generate some content.  I can use Sitemesh to decorate it.  I can do all the "hello world" apps in each of the respective tools.  I'm trying to integrate some of them and get a feel for how these tools work together.
> 
> What I think I want to do is use Sitemesh to handle page composition/decoration.  I see that there is a lot of activity recently about Sitemesh and composition enhancements.  I'd love to see them.  I want to use Velocity to create content to apply my decorators to. Example:
> 
> <page:applyDecorator name="main" page="/vm/cart.vm"/>
> 
> I can't seem to use a velocity template as content for a decorator to decorate.
> 
> I have found Velocity decorators, but
> 
> #parse( "/vm/cart.vm" )
> 
> is in no way the same.  It seems to represent the same problems the old includes provided.
> 
> Maybe I am missing a fairly large neon sign.  Any suggestions?
> 
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=1139&messageID=3645#3645
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.