velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Overriding the default precedence of the template engine
Date Thu, 20 Jul 2006 21:31:23 GMT
Yes that would accomplish the same thing.  It just shifts the
precendence burden to the template author.  I guess Will and I were
just assuming Mike meant exactly what he asked, that the template
would just be

#set( $this = 'Velocity' )
$this is great.

On 7/20/06, Withers John Z <John.Withers@irs.gov> wrote:
> Will,
>
> Wouldn't a template like:
>
> #if (! $this)
>  #set ($this = 'Velocity')
> #end
> $this is great!
>
> Do what is desired?
>
> John Withers
>
> -----Original Message-----
> From: Will Glass-Husain [mailto:wglass@forio.com]
> Sent: Thursday, July 20, 2006 7:56 AM
> To: Velocity Users List
> Subject: Re: Overriding the default precedence of the template engine
>
> Hi Mike,
>
> Not sure.  The basic premise behind Velocity is this notion of the
> application providing the context and then the template being filled
> out.  Such an approach keeps things simple.
>
> You might look at the Velocity Tools project -- there's a item called
> RenderTool that lets a Velocity template evaluate more text within
> itself.
>
> WILL
>
> Smith, Mike H wrote:
> > Hi,
> >
> >
> >
> > Is there a way to modify the precedence logic of the template engine?
> >
> >
> >
> > In particular, I'd like to:
> >
> >
> >
> >
> >
> > 1.    Define a template like:
> >
> >
> >
> > #set( $this = "Velocity")
> >
> > $this is great!
> >
> >
> >
> > 2.    Within the application code, set the "this" property to be
> > something different (e.g. "Laughter")
> > 3.    Then have the engine render as "Laughter is great"
> >
> >
> >
> >
> >
> > With the current implementation the rendering precedence is template
> > then context, any easy way to reverse this?
> >
> >
> >
> > Thanks.
> >
> > Mike
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> phone (415) 440-7500 x89
> mobile (415) 235-4293
> wglass@forio.com
> www.forio.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message