Generate a new block for related posts

References #3
This commit is contained in:
Oliver Davies 2021-01-11 00:16:40 +00:00
parent 3546ac427a
commit 6436e3edb3

View file

@ -0,0 +1,24 @@
<?php
namespace Drupal\opdavies_blog\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* @Block(
* id = "opdavies_blog_related_posts",
* admin_label = @Translation("Related Posts"),
* category = @Translation("Blog")
* )
*/
class RelatedPostsBlock extends BlockBase {
public function build(): array {
$build['content'] = [
'#markup' => $this->t('It works!'),
];
return $build;
}
}