title: django templates - passing variables between templates
body: <p>I have one template that includes a popup page. I loop through all values in a list that I get from the view and want to include information from each element of the list in the popup.</p>
  
  <p>page1.html:</p>
  
  <pre><code>{% include "popup.html" %}
  ...
  {% for element in someList %}
      &lt;div class="col s3 some-button"&gt;&lt;a onclick="$(showPopup('popup'));"&gt;More Info&lt;/a&gt;&lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <p>showPopup is a Javascript function that will show the popup.</p>
  
  <p>In popup.html I reference <code>element</code> from the for loop above:</p>
  
  <p>popup.html</p>
  
  <pre><code>...
  {{ element }} 
  ...
  </code></pre>
  
  <p>But the popup.html template does not seem to be able to find the <code>element</code> from the for loop, since nothing is shown. Is there a way to make it so the popup.html is able to reference <code>element</code>? </p>