Add infinite scroll configuration into the template instead of the javascript.