velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Ruby <st...@rubysolutions.com>
Subject Re: VTL syntax
Date Wed, 21 Feb 2001 19:14:13 GMT
Steve Ruby wrote:
> 
> Jason van Zyl wrote:
> >
> > > yah, a little hacky but i like it ... in VTL, however, since there are no
> > > delimiters for keywords except whitespace, i can't do it ... If i try:
> > >
> > > <FONT color="#if($Error)red#elseblack#endif">
> >
> > #if($Error)red#elseblack#end">
> >
> > There is no #endif
> 
> Something similar on my end did not render properly as
> above, it actually printed out #elseblack
> 
> something like this worked with no extra space in the output
> 
> #if($Error)red#else black#end">

I'm wrong.. mine didn't work when the test was false..

but Jason's doesn't work either, it outputs #else

IMHO the best way to handle this in velocity would
be to have an if directive that was more like a function
than a statement as many other langes have such as

#iif( $Statement, truevalue, falsevalue )
that sure would  be the cleanest way on the template side.

For now you may juave have to expand your font tag
out into multiple lines or better yet make it a macro

Mime
View raw message