diff --git a/system/src/Grav/Common/Twig/Twig.php b/system/src/Grav/Common/Twig/Twig.php index 74d3e0a8e..dd7241147 100644 --- a/system/src/Grav/Common/Twig/Twig.php +++ b/system/src/Grav/Common/Twig/Twig.php @@ -85,9 +85,6 @@ public function init() $active_language = $language->getActive(); - // Add Grav core templates location - $this->twig_paths[] = $locator->findResource('system://templates'); - // handle language templates if available if ($language->enabled()) { $lang_templates = $locator->findResource('theme://templates/' . ($active_language ? $active_language : $language->getDefault())); @@ -100,6 +97,9 @@ public function init() $this->grav->fireEvent('onTwigTemplatePaths'); + // Add Grav core templates location + $this->twig_paths = array_merge($this->twig_paths, $locator->findResources('system://templates')); + $this->loader = new \Twig_Loader_Filesystem($this->twig_paths); $this->grav->fireEvent('onTwigLoader');