Skip to content

Instantly share code, notes, and snippets.

@farmerbradllc
Created October 25, 2011 18:08
Show Gist options
  • Save farmerbradllc/1313689 to your computer and use it in GitHub Desktop.
Save farmerbradllc/1313689 to your computer and use it in GitHub Desktop.
Velocity Count and HasNext
#foreach ($nav_item in $nav_items)
#if($velocityCount == 1)
// Do something for the first $nav_item
#end
#if(!$velocityHasNext)
// Do something for the last $nav_item
#end
#end
#foreach ($nav_item in $nav_items)
#if($velocityCount == 3)
#break // break will exit the foreach loop
#end
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment