diff --git a/src/ScaffoldServiceProvider.php b/src/ScaffoldServiceProvider.php index 751759d..e8fc323 100644 --- a/src/ScaffoldServiceProvider.php +++ b/src/ScaffoldServiceProvider.php @@ -74,7 +74,7 @@ public function bootingPackage(): void __DIR__ . '/../stubs/resources/views/blocks/FacetWP/loops/knowledgebase-loop.blade.php' => resource_path('views/blocks/FacetWP/loops/knowledgebase-loop.blade.php'), __DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/knowledgebase.blade.php' => resource_path('views/blocks/FacetWP/templates/knowledgebase.blade.php'), __DIR__ . '/../stubs/resources/views/single-knowledgebase.blade.php' => resource_path('views/single-knowledgebase.blade.php'), - __DIR__ . '/../stubs/acf-json/group_66e0254a243fd.json' => base_path('acf-json/group_66e0254a243fd.json'), + __DIR__ . '/../stubs/FieldGroups/Knowledgebase.php' => app_path('FieldGroups/Knowledgebase.php'), ], 'knowledgebase'); $this->publishes([ @@ -88,11 +88,11 @@ public function bootingPackage(): void __DIR__ . '/../stubs/resources/views/blocks/FacetWP/templates/person.blade.php' => resource_path('views/blocks/FacetWP/templates/person.blade.php'), __DIR__ . '/../stubs/resources/views/components/meta/person.blade.php' => resource_path('views/components/meta/person.blade.php'), __DIR__ . '/../stubs/resources/views/single-person.blade.php' => resource_path('views/single-person.blade.php'), - __DIR__ . '/../stubs/acf-json/group_66e02ff47667d.json' => base_path('acf-json/group_66e02ff47667d.json'), + __DIR__ . '/../stubs/FieldGroups/Person.php' => app_path('FieldGroups/Person.php'), ], 'person'); $this->publishes([ - __DIR__ . '/../stubs/acf-json/group_66e0254a243fe.json' => base_path('acf-json/group_66e0254a243fe.json'), + __DIR__ . '/../stubs/FieldGroups/Project.php' => app_path('FieldGroups/Project.php'), __DIR__ . '/../stubs/Data/ProjectData.php' => app_path('Data/ProjectData.php'), __DIR__ . '/../stubs/View/Components/Card/Project.php' => app_path('View/Components/Card/Project.php'), __DIR__ . '/../stubs/config/facetwp/facets/project_region.php' => config_path('facetwp/facets/project_region.php'), diff --git a/stubs/FieldGroups/Knowledgebase.php b/stubs/FieldGroups/Knowledgebase.php new file mode 100644 index 0000000..a62380b --- /dev/null +++ b/stubs/FieldGroups/Knowledgebase.php @@ -0,0 +1,36 @@ +postTypes(['knowledgebase']) + ->postStatus(['publish']) + ->instructions('Standaard worden er 3 artikelen van hetzelfde type getoond. Als je zelf wilt bepalen welke artikelen getoond moeten worden, dan kun je dat hier selecteren.') + ->filters(['search', 'taxonomy']) + ->max(3), + ]; + } + + public function getLocation(): array + { + return [ + Location::where('post_type', '==', 'knowledgebase'), + ]; + } +} diff --git a/stubs/FieldGroups/Person.php b/stubs/FieldGroups/Person.php new file mode 100644 index 0000000..326ccdc --- /dev/null +++ b/stubs/FieldGroups/Person.php @@ -0,0 +1,34 @@ +postTypes(['project']) + ->postStatus(['publish']) + ->instructions('Standaard worden er 3 projecten van hetzelfde type getoond. Als je zelf wilt bepalen welke projecten getoond moeten worden, dan kun je dat hier selecteren.') + ->filters(['search', 'taxonomy']) + ->max(3), + TrueFalse::make('Niet tonen in overzicht', 'project_hide') + ->stylisedUi(), + TrueFalse::make('Is een informatiepagina', 'project_is_information_post') + ->instructions('Vink dit aan als de post een informatiepagina is, en geen deelproject. Bijvoorbeeld: "Meedenken over de herinrichting Dorpsstraat" is een informatiepagina van het hoofdproject "Herinrichting Dorpsstraat".

Let op:
Vergeet niet ook een hoofdpagina te selecteren én de optie "Niet tonen in overzicht" aan te vinken.') + ->stylisedUi(), + ]; + } + + public function getLocation(): array + { + return [ + Location::where('post_type', '==', 'project'), + ]; + } +} diff --git a/stubs/acf-json/group_66e0254a243fd.json b/stubs/acf-json/group_66e0254a243fd.json deleted file mode 100644 index 11e2798..0000000 --- a/stubs/acf-json/group_66e0254a243fd.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "key": "group_66e0254a243fd", - "title": "Kennisbank instellingen", - "fields": [ - { - "key": "field_66e0254a9ae6e", - "label": "Gerelateerde artikelen", - "name": "knowledgebase_related", - "aria-label": "", - "type": "relationship", - "instructions": "Standaard worden er 3 artikelen van hetzelfde type getoond. Als je zelf wilt bepalen welke artikelen getoond moeten worden, dan kun je dat hier selecteren.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "post_type": [ - "knowledgebase" - ], - "post_status": [ - "publish" - ], - "taxonomy": "", - "filters": [ - "search", - "taxonomy" - ], - "return_format": "object", - "min": "", - "max": 3, - "allow_in_bindings": 0, - "elements": "", - "bidirectional": 0, - "bidirectional_target": [] - } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "knowledgebase" - } - ] - ], - "menu_order": 0, - "position": "normal", - "style": "default", - "label_placement": "left", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": 0, - "modified": 1726041498 -} diff --git a/stubs/acf-json/group_66e0254a243fe.json b/stubs/acf-json/group_66e0254a243fe.json deleted file mode 100644 index 2714365..0000000 --- a/stubs/acf-json/group_66e0254a243fe.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "key": "group_66e0254a243fe", - "title": "Projectinstellingen", - "fields": [ - { - "key": "field_66e0254a9ae6e", - "label": "Gerelateerde projecten", - "name": "project_related", - "aria-label": "", - "type": "relationship", - "instructions": "Standaard worden er 3 projecten van hetzelfde type getoond. Als je zelf wilt bepalen welke projecten getoond moeten worden, dan kun je dat hier selecteren.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "post_type": [ "project" ], - "post_status": [ "publish" ], - "taxonomy": "", - "filters": [ "search", "taxonomy" ], - "return_format": "object", - "min": "", - "max": 3, - "allow_in_bindings": 0, - "elements": "", - "bidirectional": 0, - "bidirectional_target": [] - }, - { - "key": "field_659c14aaa3aff", - "label": "Niet tonen in overzicht", - "name": "project_hide", - "aria-label": "", - "type": "true_false", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "message": "", - "default_value": 0, - "ui_on_text": "", - "ui_off_text": "", - "ui": 1 - }, - { - "key": "field_65b11086f89bf", - "label": "Is een informatiepagina", - "name": "project_is_information_post", - "aria-label": "", - "type": "true_false", - "instructions": "Vink dit aan als de post een informatiepagina is, en geen deelproject. Bijvoorbeeld: \"Meedenken over de herinrichting Dorpsstraat\" is een informatiepagina van het hoofdproject \"Herinrichting Dorpsstraat\".\r\n

\r\nLet op:
\r\nVergeet niet ook een hoofdpagina te selecteren én de optie \"Niet tonen in overzicht\" aan te vinken.", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "message": "", - "default_value": 0, - "allow_in_bindings": 1, - "ui_on_text": "", - "ui_off_text": "", - "ui": 1 - } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "project" - } - ] - ], - "menu_order": 0, - "position": "normal", - "style": "default", - "label_placement": "left", - "instruction_placement": "field", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": 0, - "modified": 1749540590 -} diff --git a/stubs/acf-json/group_66e02ff47667d.json b/stubs/acf-json/group_66e02ff47667d.json deleted file mode 100644 index 2c62e63..0000000 --- a/stubs/acf-json/group_66e02ff47667d.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "key": "group_66e02ff47667d", - "title": "Persoon instellingen", - "fields": [ - { - "key": "field_66e02ff422b9c", - "label": "Functie", - "name": "person_function", - "aria-label": "", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "maxlength": "", - "allow_in_bindings": 0, - "placeholder": "", - "prepend": "", - "append": "" - }, - { - "key": "field_66e0301122b9d", - "label": "E-mailadres", - "name": "person_email", - "aria-label": "", - "type": "email", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "allow_in_bindings": 0, - "placeholder": "", - "prepend": "", - "append": "" - }, - { - "key": "field_66e0302222b9e", - "label": "Telefoonnummer", - "name": "person_phone", - "aria-label": "", - "type": "text", - "instructions": "", - "required": 0, - "conditional_logic": 0, - "wrapper": { - "width": "", - "class": "", - "id": "" - }, - "default_value": "", - "maxlength": "", - "allow_in_bindings": 0, - "placeholder": "", - "prepend": "", - "append": "" - } - ], - "location": [ - [ - { - "param": "post_type", - "operator": "==", - "value": "person" - } - ] - ], - "menu_order": 0, - "position": "normal", - "style": "default", - "label_placement": "left", - "instruction_placement": "label", - "hide_on_screen": "", - "active": true, - "description": "", - "show_in_rest": 0, - "modified": 1725969415 -}