fix a bug in carousels and inject mtypes to all templates