我include在Drupal中创建了一个:
{% include directory ~ '/partials/header.html.twig' %}
但我收到此错误:
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).
根据Drupal和Twig文档,我正在以正确的方式进行操作。
我有一个目录partials,一个文件header.html.twig。
我究竟做错了什么?我在El Capitan的MAMP和OSX中运行Drupal。Drupal 8.3.7