<% _.each(images, function(value, imageid) { %> <% if (isadmin) { %> foo <% } else { %> bar <% } %> <% } %>