title: How to make run a for loop in child template of jinja/how to access the variable inside child jinja template which is passed by the python flask file
body: <p><strong>I am making a child template in jinja which extends the parent template.In child template I am passing a variable to run a for loop in jinja template,but that part of for loop is not accessible inside the html page in chrome.
  parent template-In parent template there is only navbar.</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="static\navbar.css?v=1.1"&gt;  
           {% block head %}{% endblock %}
      &lt;/head&gt;
      &lt;body&gt;
          &lt;nav class="menu"&gt;
              &lt;ul&gt;
                &lt;li&gt;Website&lt;/li&gt;
                &lt;form action="{{ url_for('search') }}" class="search-form"  target="_blank" method="POST"&gt;
                  &lt;input type="text" name="text" placeholder="Search here.."&gt;
                  &lt;button&gt;Search&lt;/button&gt; 
                &lt;/form&gt;
                  {% if name %}
                    &lt;li&gt;&lt;a href="#"&gt;{{name}}&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="{{ url_for('logout') }}"&gt;Logout&lt;/a&gt;&lt;/li&gt;
                  {% else %}
                    &lt;li&gt;&lt;a href="{{ url_for('open_login') }}"&gt;Login &amp; SignUp&lt;/a&gt;&lt;/li&gt;
                  {% endif %}
  
                  &lt;li&gt;&lt;a href="{{ url_for('display_cart') }}"&gt;&lt;i class="fas fa-cart-plus"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;   
              &lt;/ul&gt;
          &lt;/nav&gt;
  
          {% block content %}
          {% endblock %}
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Child template -In child template i am passing a variable for the for loop,but it is not working.</strong></p>
  
  <pre><code>{% extends 'navbar.html' %}
  {% block head %}
  
          &lt;title&gt;Flipkart&lt;/title&gt;
           &lt;!--new version 2nd way to update css--&gt;
          &lt;link rel="stylesheet" href="static\gallary.css"&gt;
          &lt;script src="https://kit.fontawesome.com/04c28a3c9a.js"&gt;&lt;/script&gt;
  
  {% endblock %}
  {% block content %}      
      &lt;div class="description"&gt;
          Shopping Website
      &lt;/div&gt;
      &lt;hr&gt;
      &lt;h2&gt;Deals Of The Day&lt;/h2&gt;
      &lt;hr&gt;
      {% for i in ids %}       -----this part is not coming in browser.----
          &lt;h1&gt;sasad&lt;a href="{{ url_for('products_desc', item='shoes', id=i) }}"&gt;Link {{i}}&lt;/a&gt;&lt;/h1&gt;
  
      {% endfor %}
    {% endblock %}
  </code></pre>
  
  <p><strong>Flask file -- products function</strong> </p>
  
  <pre><code>@app.route('/products')
  def products():
      cursor = mysql.connection.cursor(MySQLdb.cursors.DictCursor)
      cursor.execute('SELECT id FROM shoes')
      shoes_ids=cursor.fetchall() 
  
      print(shoes_ids)
      ids = []
  
      for shoes_id in shoes_ids:
          ids.append(shoes_id['id']) 
  
  
      return render_template('navbar.html',ids=ids)   ---here i am passing the 
                                                         variable to the child 
                                                         template-----
  
  
  
  
  I want the for loop content to be displayed on the browser.
  </code></pre>