diff --git a/system/blueprints/config/system.yaml b/system/blueprints/config/system.yaml index 60e16f817..80eb4c039 100644 --- a/system/blueprints/config/system.yaml +++ b/system/blueprints/config/system.yaml @@ -227,7 +227,7 @@ form: highlight: asc default: desc help: PLUGIN_ADMIN.TWIG_FIRST_HELP - highlight: 1 + highlight: 0 options: 1: PLUGIN_ADMIN.YES 0: PLUGIN_ADMIN.NO diff --git a/system/config/system.yaml b/system/config/system.yaml index e88028801..0fc94b384 100644 --- a/system/config/system.yaml +++ b/system/config/system.yaml @@ -31,7 +31,7 @@ pages: process: markdown: true # Process Markdown twig: false # Process Twig - twig_first: true # Process Twig before markdown when processing both on a page + twig_first: false # Process Twig before markdown when processing both on a page events: page: true # Enable page level events twig: true # Enable twig level events diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 77f4470fa..aa7ab1dbf 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -484,9 +484,9 @@ class Page $process_markdown = $this->shouldProcess('markdown'); $process_twig = $this->shouldProcess('twig'); - $cache_enable = isset($this->header->cache_enable) ? $this->header->cache_enable : true; + $cache_enable = isset($this->header->cache_enable) ? $this->header->cache_enable : $config->get('system.cache.enabled', true); $twig_first = isset($this->header->twig_first) ? $this->header->twig_first : $config->get('system.pages.twig_first', true); - $twig_already_processed = false; + // if no cached-content run everything if ($this->content === false || $cache_enable == false) { @@ -496,7 +496,6 @@ class Page if ($twig_first) { if ($process_twig) { $this->processTwig(); - $twig_already_processed = true; } if ($process_markdown) { $this->processMarkdown(); @@ -518,7 +517,6 @@ class Page if ($process_twig) { $this->processTwig(); - $twig_already_processed = true; } if ($cache_enable) { $this->cachePageContent(); @@ -526,11 +524,6 @@ class Page } } - // only markdown content cached, process twig if required and not already processed - if ($process_twig && !$cache_enable && !$twig_already_processed) { - $this->processTwig(); - } - // Handle summary divider $delimiter = $config->get('site.summary.delimiter', '==='); $divider_pos = mb_strpos($this->content, "

{$delimiter}

");