set attrs when template is fn