velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Dennie" <dougden...@elluminate.com>
Subject RE: Overriding the default precedence of the template engine
Date Thu, 20 Jul 2006 13:19:01 GMT
Well you could just change your template to:

1.	Define a template like:

 
#if( $this )   ##does this exist in the context
#else
   #set( $this = "Velocity")
#end

$this is great!

I am not sure if $this refers to any special velocity construct. If so
just change your tag name.

Cheers,

Doug Dennie

-----Original Message-----
From: Smith, Mike H [mailto:Mike.H.Smith@pfizer.com] 
Sent: Thursday, July 20, 2006 5:07 AM
To: velocity-user@jakarta.apache.org
Subject: Overriding the default precedence of the template engine

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

 

 

 


---------------------------------------------------------------------
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