fixes #4672 - added template_name template variable