Cut the template into layouts