Added support for template layouts.