velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Withers John Z" <John.With...@irs.gov>
Subject RE: Overriding the default precedence of the template engine
Date Thu, 20 Jul 2006 16:56:58 GMT
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


Mime
View raw message