-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLANET-7550: Move Deep Dive Topic pattern block to theme (#2339)
* PLANET-7550: Add Deep Dive Topic pattern block - The Deep Dive Topic pattern was moved to the theme * PLANET-7550: Fix php lint errors - PHP lint errors were fixed * PLANET-7550: Fix file format - Identation was fixed and an empty line was added at the end of the file
- Loading branch information
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import metadata from './block.json'; | ||
import template from './template'; | ||
|
||
export {metadata, template}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* DeepDiveTopic class. | ||
* | ||
* @package P4\MasterTheme\Patterns | ||
* @since 0.1 | ||
*/ | ||
|
||
namespace P4\MasterTheme\Patterns; | ||
|
||
/** | ||
* Class DeepDiveTopic. | ||
* | ||
* @package P4\MasterTheme\Patterns | ||
*/ | ||
class DeepDiveTopic extends BlockPattern | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function get_name(): string | ||
{ | ||
return 'p4/deep-dive-topic-pattern-layout'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function get_config($params = []): array | ||
{ | ||
return [ | ||
'title' => 'Deep Dive Topic', | ||
'categories' => [ 'layouts' ], | ||
'blockTypes' => [ 'core/post-content' ], | ||
'content' => ' | ||
<!-- wp:planet4-block-templates/deep-dive-topic ' . | ||
wp_json_encode($params, \JSON_FORCE_OBJECT) . | ||
' /-->', | ||
]; | ||
} | ||
} |