Velocity macros in File Templates

I thought that the File Templates feature used Velocity and because of that I could use Velocity macros. The idea is to put the Velocity Macros in an entry on the "Includes" tab and then pull the macros into the different templates with a #parse(). Unfortunately the behavior on the below macro that I am seeing is that only the substring(1) value is returned and an extra newline is being inserted.

${#macro( fieldCase$foo )
#**##set( $str = "$foo" )
#**#$str.substring(0,0).toLowerCase()$str.substring(1)
#end}

Is this possible? Am I doing something wrong? Is there another way (non-Velocity) to do this? This is my first attempt at using Velocity. Thank you for any assistance.

Frederick N. Brier

Please sign in to leave a comment.