started to use smarty to generate the fields