Added template selection before page creation