velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghu Rajah <rraghu...@hotmail.com>
Subject RE: Blocks in Velocimacros
Date Thu, 03 Jan 2008 22:49:07 GMT
I think I will go the custom directive route. 

Thanks for all the pointers. I especially like the Hacking Velocity presentation - rather
groovy. It addresses nearly all the issues I had.

Raghu.


> Date: Thu, 3 Jan 2008 14:37:35 -0800
> From: nbubna@gmail.com
> To: user@velocity.apache.org
> Subject: Re: Blocks in Velocimacros
> 
> Of course, you would then have to be sure to escape all " characters
> in your body content:
> 
> #set( $Q = '"' )
> 
> #myForm( "
> <!-- some ${Q}arbitrary${Q} -->
> " )
> 
> so that you don't prematurely end your $body parameter.  this is
> obviously not ideal, but may be easier than writing a custom
> directive, depending on the specifics of your case(s).
> 
> On Jan 3, 2008 2:35 PM, Nathan Bubna <nbubna@gmail.com> wrote:
> > Also note that as of Velocity 1.5, you can include line breaks in
> > strings, making it reasonable (though not as pretty to do something
> > like:
> >
> > #macro( myForm $body )
> > <form...>
> > $body
> > </form>
> > #end
> >
> > #myForm("
> > <!-- some arbitrary html here -->
> > ")
> >
> >
> >
> > On Jan 2, 2008 7:13 PM, Raghuram Rajah <rraghuram@hotmail.com> wrote:
> >
> > > Can I use a block within a velocimacro? Basically, I am trying to create a
macro that will emit a XHTML tag with some javascript out. I would hate to create a begin
macro and an end macro to accomplish this. That would be rather error prone.
> > >
> > > I would ideally like to do something like,
> > >
> > > #myForm(...)
> > >   <!-- some arbitrary html here -->
> > > #end
> > >
> > > generating something like
> > >
> > > <form ....
> > >   <!-- some arbitrary html here -->
> > > </form>
> > >
> > > Any suggestions would be greatly appreciated.
> > >
> > > Thanks,
> > > Raghu.
> > >
> > > _________________________________________________________________
> > > Share life as it happens with the new Windows Live.
> > > http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 

_________________________________________________________________
i’m is proud to present Cause Effect, a series about real people making a difference.
http://im.live.com/Messenger/IM/MTV/?source=text_Cause_Effect
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message