The (#set ($_dummy ... is a bit different than other velocity. The .put command normally echoes to the screen, so assigning it to $_dummy just suppresses it, you could use any variable there)
Using the _ as part of the variable is just a habit I picked up from someone here (Keiter?) to show it is a dummy/throwaway variable.
Lastly, the $sorter.sort takes its sorting list a little differently, note the ["..."] inside the command. (if you give just "pathdepth:asc" it works without the array brackets, but you need them for the second sort element. )
Exceptions and inconsistencies galore!
Mark Pitely
Marywood University