diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 108f05db7..e7eca9dcb 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -144,7 +144,19 @@ class Page public function frontmatter($var = null) { if ($var) { - $this->frontmatter = $var; + $this->frontmatter = (string) $var; + + // Update also file object. + $file = $this->file(); + if ($file) { + $file->frontmatter((string) $var); + } + + // Force content re-processing. + $this->id(time().md5($this->filePath())); + } + if (!$this->frontmatter) { + $this->header(); } return $this->frontmatter; }