From 7b4f40d3b14317dd9361de8e3936ca448ea4e989 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 13 Nov 2019 11:22:01 +0200 Subject: [PATCH] Updated blueprint for Flex Pages --- system/blueprints/flex/pages.yaml | 32 +++++++++++++++++++ system/src/Grav/Common/Page/Pages.php | 2 +- .../Common/Processors/PluginsProcessor.php | 2 -- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/system/blueprints/flex/pages.yaml b/system/blueprints/flex/pages.yaml index 275d2965a..0cd24f8d2 100644 --- a/system/blueprints/flex/pages.yaml +++ b/system/blueprints/flex/pages.yaml @@ -2,12 +2,16 @@ title: Flex Pages description: Manage your Grav Pages in Flex. type: flex-objects +# Extends a page (blueprint gets overridden inside the object) extends@: type: default context: blueprints://pages +# Flex configuration config: + # Administration Configuration (needs Flex-Objects plugin) admin: + # Admin menu menu: list: route: '/pages' @@ -16,9 +20,20 @@ config: authorize: ['admin.pages', 'admin.super'] priority: 5 + # Admin template type (folder) template: grav-pages + # Allowed admin actions + actions: + list: true + create: true + read: true + update: true + delete: true + + # List view list: + # Fields shown in the list view fields: published: width: 8 @@ -51,8 +66,11 @@ config: # updated_date: # alias: header.update_date + # Extra options options: + # Default number of records for pagination per_page: 20 + # Default ordering order: by: key dir: asc @@ -95,21 +113,30 @@ config: preview: enabled: true + # Site Configuration site: + # Hide from flex types hidden: true templates: collection: + # Lookup for the template layout files for collections of objects paths: - 'flex/{TYPE}/collection/{LAYOUT}{EXT}' object: + # Lookup for the template layout files for objects paths: - 'flex/{TYPE}/object/{LAYOUT}{EXT}' defaults: + # Default template {TYPE}; overridden by filename of this blueprint if template folder exists type: pages + # Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates) layout: default + + # Default filters for frontend. filter: - withPublished + # Data Configuration data: object: 'Grav\Common\Page\Flex\PageObject' collection: 'Grav\Common\Page\Flex\PageCollection' @@ -120,18 +147,23 @@ config: formatter: class: 'Grav\Framework\File\Formatter\MarkdownFormatter' folder: 'page://' + # Keep index file in filesystem to speed up lookups indexed: true + # Set default ordering of the pages ordering: key: ASC search: + # Search options options: contains: 1 + # Fields to be searched fields: - key - menu - title - name +# Regular form definition form: fields: lang: diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 84b14f7a9..a22f938ed 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -1298,7 +1298,7 @@ class Pages 'enabled' => true, ] + ($config->get('plugins.flex-objects.object') ?: []); - $directory = new FlexDirectory('pages', 'blueprints://flex/pages.yaml', $options); + $directory = new FlexDirectory('grav-pages', 'blueprints://flex/pages.yaml', $options); /** @var EventDispatcher $dispatcher */ $dispatcher = $this->grav['events']; diff --git a/system/src/Grav/Common/Processors/PluginsProcessor.php b/system/src/Grav/Common/Processors/PluginsProcessor.php index b6c0c39f1..046c29791 100644 --- a/system/src/Grav/Common/Processors/PluginsProcessor.php +++ b/system/src/Grav/Common/Processors/PluginsProcessor.php @@ -21,9 +21,7 @@ class PluginsProcessor extends ProcessorBase public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $this->startTimer(); - // TODO: remove in 2.0. $this->container['accounts']; - // TODO: remove in 2.0. $this->container['pages']; $this->container['plugins']->init(); $this->container->fireEvent('onPluginsInitialized');