mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
refactor the blueprints fallback a little
This commit is contained in:
parent
65df265e30
commit
867445cbd8
|
|
@ -705,16 +705,16 @@ class Page
|
|||
$pages = self::getGrav()['pages'];
|
||||
|
||||
$blueprint = $pages->blueprints($this->blueprintName());
|
||||
|
||||
$fields = $blueprint->fields();
|
||||
$edit_mode = self::getGrav()['admin'] ? self::getGrav()['config']->get('plugins.admin.edit_mode') : null;
|
||||
|
||||
// override if you only want 'normal' mode
|
||||
if (empty($fields) && self::getGrav()['admin'] && self::getGrav()['config']->get('plugins.admin.edit_mode', 'auto') == 'normal') {
|
||||
if (empty($fields) && ($edit_mode == 'auto' || $edit_mode == 'normal')) {
|
||||
$blueprint = $pages->blueprints('default');
|
||||
}
|
||||
|
||||
// override if you only want 'expert' mode
|
||||
if (!empty($fields) && self::getGrav()['admin'] && self::getGrav()['config']->get('plugins.admin.edit_mode', 'auto') == 'expert') {
|
||||
if (!empty($fields) && $edit_mode == 'expert') {
|
||||
$blueprint = $pages->blueprints('');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user