title: django: using blocks in included templates
body: <p>I have some html structures that are reused in quite a few different places. It's different from a overall template so I can't extend it, it can also be used to contain complicated content so I don't think defining it as a template tag does a good job. Below is some <strong>pseudo code</strong> describing my desired outcome, when using template_level2.html you can easily put stuff into the reusable_pattern_template by calling the block inside it. If I do use this code, what you write in 'actual content' of template_level_2.html wouldn't show up. How should I deal with this? </p>
  
  <p>base.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  {% block content %}{% endblock %}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>template_level1.html</p>
  
  <pre><code>{% extends 'base.html' %}
  {% block content %}
    Something here...
    {% include 'reusable_pattern_template.html' %}
    Something else here...
  {% endblock %}
  </code></pre>
  
  <p>reusable_pattern_template.html</p>
  
  <pre><code>&lt;div&gt;
    &lt;div&gt;
      &lt;div&gt;
        {% block local_content %}{% endblock %}
      &lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>template_level2.html</p>
  
  <pre><code>{% extends 'template_level1.html' %}
  {% block local_content %}
    Actual content here...
  {% endblock %}
  </code></pre>
  
  <p><strong>update:</strong>
  Sorry, the extends in template_level2.html has some misspelling, I've just corrected it.</p>
  
  <p>It may not be very clear, but the code above is more of a pseudo code describing my desired outcome. In short, </p>
  
  <ul>
  <li>I would like to include small pieces of reusable html patterns in my
  templates.</li>
  <li>These patterns are like boxes, that you can put whole pieces of html
  content in them. So context variables may be a bit of too limited for
  my purpose</li>
  </ul>