Polishing It Up
Now that we have the basics working just fine, we should do some polishing. We'd like the title of the post to be displayed in the URL to make our friends from the Search Engine Optimisation (SEO) department happy and we'll make the whole blog look a little better. Let's start with the looks.
You might have noticed that our templates consisted of only the most basic html code needed to display the list or respectively the post. However, when you looked at the page there was a title tag that we were able to manipulate through a template variable and the page title was also set. If you had a look at the HTML source you'd have noticed that it is indeed valid xhtml. How did that happen?
Old style PHP applications often made use of included snippets of HTML code, often called header and footer. Those were included in the templates to factor out common html code. Agavi has a mechanism to factor out common code but it works far better than using includes. It's called layers. When we created the application using the Agavi build script a very basic set of layers was created and configured for us. In the following chapter we'll go through those to understand what this is all about.
We'll be using the open source Emplode template by Arcsin, which can be obtained from the resources/template/ directory of this tutorial or from http://templates.arcsin.se/emplode-website-template/. The result of this chapter is the http://www.agavi.org/guide/stages/stage4.tgz application.

