added new blueprintName() method that takes into account blueprint value passed via a form

This commit is contained in:
Andy Miller
2015-07-29 22:00:03 -06:00
parent b201b21e46
commit c4daae2f95

View File

@@ -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;
}
/**