diff --git a/CHANGELOG.md b/CHANGELOG.md index 071541677..90d970d56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#new) * Plugins & Themes: Call `$plugin->autoload()` and `$theme->autoload()` automatically when object gets initialized + * Flex Directory: Implemented customizable configuration * Flex Storages: Added support for renaming directory entries 1. [](#bugfix) * Regression: Fixed fatal error in blueprints [#2811](https://github.com/getgrav/grav/issues/2811) diff --git a/system/blueprints/flex/shared/configure.yaml b/system/blueprints/flex/shared/configure.yaml index 158fc5f61..e3e5dcbe3 100644 --- a/system/blueprints/flex/shared/configure.yaml +++ b/system/blueprints/flex/shared/configure.yaml @@ -2,7 +2,7 @@ form: validation: loose fields: - plugin_tabs: + tabs: type: tabs fields: cache: diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index 067a5b8af..fd556e396 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -183,9 +183,17 @@ class FlexDirectory implements FlexAuthorizeInterface public function getDirectoryBlueprint() { $name = 'configure'; + + $type = $this->getBlueprint(); + $overrides = $type->get("blueprints/{$name}"); + $path = "blueprints://flex/shared/{$name}.yaml"; $blueprint = new Blueprint($path); - $blueprint->load()->init(); + $blueprint->load(); + if ($overrides) { + $blueprint->embed('form/fields/tabs/fields', $overrides['fields']); + } + $blueprint->init(); return $blueprint; } @@ -237,8 +245,9 @@ class FlexDirectory implements FlexAuthorizeInterface public function getDirectoryConfigUri(string $name = null): string { $name = $name ?: $this->getFlexType(); + $blueprint = $this->getBlueprint(); - return "config://flex/{$name}.yaml"; + return $blueprint->get('blueprints/configure/file') ?? "config://flex/{$name}.yaml"; } protected function getDirectoryConfig(string $name = null): array