autogen: support attribute 'templates'