convert widget to template