Added orientation support to templates