Added layout support to templates