From 6ae4680fcb5944f404df74da486057bb8a1ad032 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 1 Dec 2017 11:38:38 -0700 Subject: [PATCH] Move system twig templates to last --- system/src/Grav/Common/Twig/Twig.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 @@ class Twig $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 @@ class Twig $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');