title: Inheritance in jinja2 templates
body: <p>I've question about inheritance in jinja2. </p>
  
  <p>Here is my layout.html looks like:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div id='header'&gt;Some header stuff&lt;/div&gt;
  &lt;div id='left-panel'&gt;{% block lpanel %}&lt;/div&gt;
  &lt;div id='content'&gt;{% block content %}&lt;/div&gt;
  &lt;div id='right-panel'&gt;{% block rpanel %}&lt;/div&gt;
  &lt;div id='footer'&gt;Some footer stuff&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>3 divs (left and right panels and content) are dynamical and should be filled with some functions.</p>
  
  <p>Now the question: what should i do, to achieve my goal in proper way?</p>
  
  <p>Should I create some child templates here? Or maybe my functions, which create content for those 3 divs should return HTML and I should pass it's result as parameters to layout template? (not the most elegant solution...) Any other way?                     </p>
  
  <p>EDIT:
  thanks for your answers, but unfortunatelly i still have some doubts... i don't know what's the proper way to connect those templates with my flask/python code...</p>
  
  <p>If i had just a layout.html and one child template, which extends the layout, then it's really simple: in python i write a function and end it with something like 'return render_template('child.html', my_varables....)</p>
  
  <p>but here i need 3 functions: one for rendering content of main 'content' div and additional 2 funtions for creating left and right panel. how can i join all 3 of them to get my output page?</p>