Yeah, actually, you can do this, but it'll take a wee bit o' work.  We
do something like this in VelocityTools to prevent templates from
overriding tool references.

You need to create and use your own custom Context that puts your
higher priority values in a different internal map than values set in
the template.   Then when a get() is called on it, you need to have it
check the non-template modified map first.  This is a rushed
explanation, but i hope it points you in the right direction.  I may
have time to help more later if you can't figure it out.

On 7/20/06, Smith, Mike H <[EMAIL PROTECTED]> 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










---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to