Only override element and module templates in the front end (see #6878)