title: Using if statements with jinja
body: <p>I am passing in results to my HTML file, which contains a tuple and each of the elements in the tuple is a dictionary. The row element contains five fields, one of which is url. I want to insert a different image for each element in row based on its url field. I also passed in three different url variables to my HTML file, each containing one of the possible urls as a string. Can I use jinja if statements to check equality of two strings (one being the value of the url field in rows and the other being the value of the url variables I pass into the file)? </p>
  
  <pre><code>&lt;div&gt;
  {% for row in rows %}
      {% if (row.url = trumba_url) %}
          &lt;img class="icon" src='https://pbs.twimg.com/profile_images/529755616571432960/uAELf1Xz_400x400.png'&gt;&lt;/img&gt;
      {% endif %}
      {% if (row.url = ilab_url) %}
          &lt;img class="icon" src='https://yt3.ggpht.com/-9SPiNJ7tggM/AAAAAAAAAAI/AAAAAAAAAAA/6IQqBohqQ-A/s900-c-k-no-mo-rj-c0xffffff/photo.jpg'&gt;&lt;/img&gt;
      {% endif %}
      {% if (row.url = hbs_url) %}
          &lt;img class="icon" src='http://www.davidkhurst.com/wp-content/uploads/2013/09/Harvard_shield-Business.png'&gt;&lt;/img&gt;
      {% endif %}
      &lt;p class="event-title"&gt;&lt;a href='{{ row.url }}'&gt;{{ row.title }}&lt;/a&gt;&lt;/p&gt;
      &lt;p class="event-date"&gt;{{ row.date }}&lt;/p&gt;
      &lt;p class="event-location"&gt;{{ row.location }}&lt;/p&gt;
      &lt;br&gt;&lt;/br&gt;
  {% endfor %}
  &lt;/div&gt;
  </code></pre>
  
  <p>In my python file which runs the website using flask, I have this as well as some more code that defines the tuples in results[].</p>
  
  <pre><code>trumba_url = 'http://www.trumba.com/events-calendar/ma/boston/harvard-events/harvard-event-calendar/harvard-activities/gazette'
  ilab_url = 'https://i-lab.harvard.edu/events/'
  hbs_url = 'http://www.hbs.edu/mba/admissions/admissions-events/Pages/default.aspx'
  
  return render_template("index.html", results=results, trumba_url=trumba_url, ilab_url=ilab_url, hbs_url=hbs_url) 
  </code></pre>