Collect sets of template output to order by a particular datum