title: Symfony include navbar html into Twig template
body: <p>My Symfony application has a defaultBundle which loads a default.html.twig successfully.</p>
  
  <p>I am trying to include the contents of a navbar.html.twig into default.html.twig. The following code is my attempt to include the navbar code:</p>
  
  <pre><code>{% block body %}
  
      {% include ('navbar.html.twig') %} &lt;!-- this generates the error --&gt;
  
      &lt;div class='content'&gt;
          {{ include('@Stock/StockController/create.html.twig') }} &lt;!-- this works--&gt;
          {{ include('@Sales/Sales/add.html.twig') }}     &lt;!-- this works --&gt;
      &lt;/div&gt;
  
  {% endblock %}
  </code></pre>
  
  <p>Both default.html.twig and navbar.hmtl.twig are in the same directory so I assumed my include code above should work but I get the following error:</p>
  
  <blockquote>
    <p>Unable to find template "@navbar.html.twig" in ::base.html.twig at
    line 10.</p>
  </blockquote>
  
  <p>My Symfony skills are not quite acute yet so I'm not sure what the connection to base.html.twig is. How can I resolve this?</p>
  
  <p>PS:</p>
  
  <p>Just in case, the navbar code is from BootStrap and is as follows:</p>
  
  <pre><code>    &lt;nav class="navbar navbar-default"&gt;
    &lt;div class="container-fluid"&gt;
      &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
      &lt;div class="navbar-header"&gt;
        &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"&gt;
          &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;span class="icon-bar"&gt;&lt;/span&gt;
        &lt;/button&gt;
        &lt;a class="navbar-brand" href="#"&gt;Brand&lt;/a&gt;
      &lt;/div&gt;
  
      &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
      &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
        &lt;ul class="nav navbar-nav"&gt;
          &lt;li class="active"&gt;&lt;a href="#"&gt;Link &lt;span class="sr-only"&gt;(current)&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
            &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"&gt;Dropdown &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
            &lt;ul class="dropdown-menu" role="menu"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Another action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Something else here&lt;/a&gt;&lt;/li&gt;
              &lt;li class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Separated link&lt;/a&gt;&lt;/li&gt;
              &lt;li class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;One more separated link&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
        &lt;form class="navbar-form navbar-left" role="search"&gt;
          &lt;div class="form-group"&gt;
            &lt;input type="text" class="form-control" placeholder="Search"&gt;
          &lt;/div&gt;
          &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
        &lt;/form&gt;
        &lt;ul class="nav navbar-nav navbar-right"&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
            &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"&gt;Dropdown &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
            &lt;ul class="dropdown-menu" role="menu"&gt;
              &lt;li&gt;&lt;a href="#"&gt;Action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Another action&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Something else here&lt;/a&gt;&lt;/li&gt;
              &lt;li class="divider"&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#"&gt;Separated link&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
    &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
  &lt;/nav&gt;
  </code></pre>
  
  <h2>Update</h2>
  
  <p>Thanks to everyone who has suggested answers. I updated my code to show include statements from other bundles which work. The worrying thing is I have tried pretty much all suggestions before and after posting my question. Still no closer to resolving this.</p>
  
  <p>The following is the tree structure of my bundle's view directory showing my 2 templates in relation to their parent directory:</p>
  
  <pre><code>.
  ├── Controller
  │  │   └── DefaultController.php
  ├── DeckBundle.php
  ├── DependencyInjection
  │   ├── Configuration.php
  │   └── DeckExtension.php
  ├── Resources
  │   ├── config
  │   │   ├── routing.yml
  │   │   └── services.yml
  │   ├── doc
  │   │   └── index.rst
  │   ├── public
  │   │   ├── config.rb
  │   │   ├── css
  │   │   │   ├── config.rb
  │   │   │   ├── sass
  │   │   │   │   ├── ie.scss
  │   │   │   │   ├── default.scss
  │   │   │   │   ├── print.scss
  │   │   │   │   └── screen.scss
  │   │   │   └── stylesheets
  │   │   │       ├── ie.css
  │   │   │       ├── default.css
  │   │   │       ├── print.css
  │   │   │       └── screen.css
  │   │   ├── images
  │   │   └── js
  │   │       └── maindeck.js
  │   ├── translations
  │   │   └── messages.fr.xlf
  │   └── views
  │       ├── Default
  │       │   ├── default.html.twig
  │       │   └── navbar.html.twig
  </code></pre>