From c4daae2f95e6ffd9488bb1f563d4e7c3cdd7dde7 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Wed, 29 Jul 2015 22:00:03 -0600 Subject: [PATCH] added new blueprintName() method that takes into account blueprint value passed via a form --- system/src/Grav/Common/Page/Page.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index 2e4529d37..42f8624a4 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -693,7 +693,19 @@ class Page /** @var Pages $pages */ $pages = self::getGrav()['pages']; - return $pages->blueprints($this->template()); + return $pages->blueprints($this->blueprintName()); + } + + /** + * Get the blueprint name for this page. Use the blueprint form field if set + * + * @return string + */ + public function blueprintName() + { + $blueprint_name = filter_input(INPUT_POST, 'blueprint', FILTER_SANITIZE_STRING) ?: $this->template(); + + return $blueprint_name; } /**