diff --git a/assets/src/block-templates/deep-dive-topic/block.json b/assets/src/block-templates/deep-dive-topic/block.json new file mode 100644 index 0000000000..20e8cb9a67 --- /dev/null +++ b/assets/src/block-templates/deep-dive-topic/block.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 2, + "name": "planet4-block-templates/deep-dive-topic", + "title": "Deep Dive Topic", + "category": "planet4-block-templates", + "icon": "editor-table", + "textdomain": "planet4-blocks-backend" +} diff --git a/assets/src/block-templates/deep-dive-topic/index.js b/assets/src/block-templates/deep-dive-topic/index.js new file mode 100644 index 0000000000..8b8d0ab4e6 --- /dev/null +++ b/assets/src/block-templates/deep-dive-topic/index.js @@ -0,0 +1,4 @@ +import metadata from './block.json'; +import template from './template'; + +export {metadata, template}; diff --git a/assets/src/block-templates/deep-dive-topic/template.js b/assets/src/block-templates/deep-dive-topic/template.js new file mode 100644 index 0000000000..b79f11ba85 --- /dev/null +++ b/assets/src/block-templates/deep-dive-topic/template.js @@ -0,0 +1,34 @@ +const {__} = wp.i18n; + +const template = () => ([ + ['core/group', {}, [ + ['planet4-block-templates/page-header', { + titlePlaceholder: __('Page header title', 'planet4-blocks'), + mediaPosition: 'right', + }], + ['core/spacer', {height: '64px'}], + ['planet4-block-templates/side-image-with-text-and-cta', { + title: __('The problem', 'planet4-blocks'), + }], + ['planet4-block-templates/side-image-with-text-and-cta', { + title: __('What can be done', 'planet4-blocks'), + mediaPosition: 'right', + }], + ['planet4-blocks/covers', { + title: __('How you can help', 'planet4-blocks'), + cover_type: 'take-action', + }], + ['planet4-blocks/articles', { + article_heading: __('Latest news & stories', 'planet4-blocks'), + }], + ['planet4-block-templates/deep-dive', { + title: __('Keep learning about', 'planet4-blocks'), + }], + ['planet4-block-templates/quick-links', { + title: __('Explore other topics', 'planet4-blocks'), + backgroundColor: 'white', + }], + ]], +]); + +export default template; diff --git a/assets/src/block-templates/template-list.js b/assets/src/block-templates/template-list.js index e48c62f8f9..fc7aae7125 100644 --- a/assets/src/block-templates/template-list.js +++ b/assets/src/block-templates/template-list.js @@ -9,6 +9,7 @@ import * as pageHeader from './page-header'; import * as highLevelTopic from './high-level-topic'; import * as homepage from './homepage'; import * as getInformed from './get-informed'; +import * as deepDiveTopic from './deep-dive-topic'; export default [ sideImgTextCta, @@ -22,4 +23,5 @@ export default [ highLevelTopic, homepage, getInformed, + deepDiveTopic, ]; diff --git a/src/Patterns/BlockPattern.php b/src/Patterns/BlockPattern.php index d1144d955c..85fc021244 100644 --- a/src/Patterns/BlockPattern.php +++ b/src/Patterns/BlockPattern.php @@ -43,6 +43,7 @@ public static function get_list(): array return [ BlankPage::class, DeepDive::class, + DeepDiveTopic::class, GetInformed::class, HighLevelTopic::class, HighlightedCta::class, diff --git a/src/Patterns/DeepDiveTopic.php b/src/Patterns/DeepDiveTopic.php new file mode 100644 index 0000000000..95696c9e91 --- /dev/null +++ b/src/Patterns/DeepDiveTopic.php @@ -0,0 +1,42 @@ + 'Deep Dive Topic', + 'categories' => [ 'layouts' ], + 'blockTypes' => [ 'core/post-content' ], + 'content' => ' + ', + ]; + } +}