detail template clean up and display related records
clean up details page