...
Note the difference here between code to execute (surrounded by <% %> tokens), expressions to evaluate (surrounded by <%= %> tokens) and static content to copy to the output (not surrounded at all). You may find keeping all this straight one of the more confusing aspects of working with CodeSmith at first. When in doubt, use the Insert Content toolbar button or the Edit > Insert Content submenu to insert the appropriate code blocks and write blocks. That way you'll get the syntax straight automatically, and can spend your time worrying about the template's logic.
IMAGE GOES HERE
With all of the pieces in place, here's the final template:
...