update layout with template