title: Import content between Twig files
body: <p>How can I have a Twig file which imports some of it's content from a second Twig file in the same or a sub directory?</p>
  
  <p>I am developing a project where multiple Twig files have content in common and I'm trying to avoid copying and pasting content between Twig files.</p>
  
  <p>So, I want to have a subdirectory containing the shared markup and simply "import" into the relevant sections of the main Twig files.</p>
  
  <p>With <strong>import.list.html.twig</strong> in the same directory as the main Twig file, I tried the following:</p>
  
  <pre><code>{% extends "::base.html.twig" %}
  
  {% block title %}StockBundle:StockController:index{% endblock %}
  
  {% block body %}
  &lt;h1&gt;Welcome to the StockController:List page&lt;/h1&gt;
  
  {% for stock in stocks %}
      &lt;div class='list'&gt;
          &lt;div class='each stock'&gt;
              &lt;span class='name'&gt;{{ stock.name }}&lt;/span&gt;
              &lt;span class='desc'&gt;{{ stock.description }}&lt;/span&gt;
              &lt;span class='balc'&gt;{{ stock.balance }}&lt;/span&gt;
              &lt;span class='edit'&gt;
                  &lt;a href="{{ path('stock_edit', {'id':stock.id}) }}"&gt;edit&lt;/a&gt;
              &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  {% endfor %}
  
  {% include 'import.list.html.twig' %}
  
  {% endblock %}
  </code></pre>
  
  <p>... but I got the following error:</p>
  
  <pre><code>Unable to find template "import.list.html.twig" in ::base.html.twig at line 10.
  </code></pre>