tags:

views:

25

answers:

1

I have this velocity template. It works fine in one case, but doesn't in another. If I remove the elseif it works fine. Has anyone encountered this?

#if (some condition)
     ## Do something 
#elseif
     ## Do something else
#end
+2  A: 

I don't know Velocity, but normally elseif is used with a second condition.

else seems to be what you need.

#if (some condition)
     ## Do something 
#else
     ## Do something else
#end
Eibx
That's correct. The right syntax would be #elseif (othercondition), or just use #else.
Will Glass