mirror of
https://github.com/getgrav/grav.git
synced 2026-02-01 12:20:22 +01:00
added new blueprintName() method that takes into account blueprint value passed via a form
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user