Like I had mentioned earlier, one of the greatest strengths of CodeSmith is it's similarity to ASP.NET's style and syntax. In particular, the ability to paste in-line content and then use script blocks (<% %>) to handle any specific template logic and scripting.
In our case, we are going to put the base HTML in-line such as setting up the head, title, body tags, etc... This is ideal for any static content you want within your template.
Outside of that, though, we're going to have quite a bit of logic to navigate through our given database and spit out the respective information.
This "template-side" code must reside within a literal <script> block within the template. Much like ASP.NET, you have to specify <script runat="template"> as well, to make sure the template parser knows to build your given code into the template when it's built and compiled.
For the purposes of my article, we will have four methods. In the following pages we will cover each method in detail.