I created an include
in Drupal:
{% include directory ~ '/partials/header.html.twig' %}
but I am getting this error:
Twig_Error_Loader: Template "themes/custom/mytheme/partials/header.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "themes/custom/mytheme/partials/header.html.twig" in the Drupal theme registry.) in "themes/custom/mytheme/page--front.html.twig" at line 1. in Twig_Loader_Chain->getCacheKey() (line 115 of vendor/twig/twig/lib/Twig/Loader/Chain.php).
According to Drupal and Twig documentation, I am doing it the right way.
I have a directory called partials
and a file called header.html.twig
.
What am I doing wrong? I am running Drupal in MAMP and OSX, El Capitan. Drupal 8.3.7