NextGen Knowledge Center

Conditional Statements

Velocity supports if..else statements, with the #if / #elseif / #else directives:

There #if($list.size()==1)is#{else}are#end ${list.size()} total value#if($list.size()!=1)s#end

The curly brackets ("{}") are only needed if the if/else/end might be confused with template data immediately before or after.