elfuchsjekyll / vosao

Automatically exported from code.google.com/p/vosao
0 stars 0 forks source link

VTL velocityHasNext variable is not available #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
VTL's #foreach element, Velocity provides velocityHasNext variable as easy
way to tell if you are on the last iteration of a loop
(http://velocity.apache.org/engine/devel/user-guide.html#Loops).
However, I cannot use the VTL velocityHasNext variable in Vosao template
and page content. It was rendered as literal, not as evaluated value when
the page was loaded on browser (FF).

I do not see the name setting for it in the velocity.properties file
(http://www.google.com/codesearch?q=velocity.properties+package%3Ahttp%3A%2F%2Fv
osao\.googlecode\.com&origq=velocity.properties&btnG=Search+Trunk).
Hence, I assumed that I could use the default name; velocityHasNext.

I tried the following VTL:
#set( $testMap={ "zero":"0", "one":"1", "two":"2"}) 
#foreach( $testValue in $testMap) 
    velocityCount=$velocityCount, velocityHasNext=$velocityHasNext,
testValue=$testValue.toString()<br />
#end
#set( $testArray={ "zero":"0", "one":"1", "two":"2"}) 
#foreach( $testValue in $testArray) 
    velocityCount=$velocityCount, velocityHasNext=$velocityHasNext,
testValue=$testValue.toString()<br />
#end

Original issue reported on code.google.com by art...@gmail.com on 21 Mar 2010 at 10:25

GoogleCodeExporter commented 9 years ago
Vosao CMS uses Velocity 1.5 now to fix issue we need to upgrade to Velocity 1.6 
to 
support these loop variables.

Original comment by kinyelo@gmail.com on 23 Mar 2010 at 8:40

GoogleCodeExporter commented 9 years ago
Implemented.

Original comment by kinyelo@gmail.com on 29 Mar 2010 at 10:47