Attribute fixes
This commit is contained in:
@@ -4,16 +4,18 @@ namespace Drupal\archive_tree\Plugin\Block;
|
|||||||
|
|
||||||
use Drupal\Core\Block\BlockBase;
|
use Drupal\Core\Block\BlockBase;
|
||||||
use Drupal\Core\Block\Attribute\Block;
|
use Drupal\Core\Block\Attribute\Block;
|
||||||
|
use Drupal\Core\StringTranslation\TranslatableMarkup;
|
||||||
use Drupal\Core\Form\FormStateInterface;
|
use Drupal\Core\Form\FormStateInterface;
|
||||||
use Drupal\node\Entity\NodeType;
|
use Drupal\node\Entity\NodeType;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides an 'Archive Tree' block.
|
* Provides an 'Archive tree' block.
|
||||||
*/
|
*/
|
||||||
#[\Drupal\Core\Block\Annotation\Block(
|
#[Block(
|
||||||
id: "archive_tree_block",
|
id: "archive_tree_block",
|
||||||
admin_label: ["Archive tree"]
|
admin_label: new TranslatableMarkup("Archive tree"),
|
||||||
|
category: new TranslatableMarkup("Menus")
|
||||||
)]
|
)]
|
||||||
|
|
||||||
class ArchiveTreeBlock extends BlockBase {
|
class ArchiveTreeBlock extends BlockBase {
|
||||||
@@ -23,6 +25,7 @@ class ArchiveTreeBlock extends BlockBase {
|
|||||||
|
|
||||||
public function defaultConfiguration() {
|
public function defaultConfiguration() {
|
||||||
return [
|
return [
|
||||||
|
// Todo: query for all content types.
|
||||||
'expand_years' => FALSE,
|
'expand_years' => FALSE,
|
||||||
'content_types' => ['article'],
|
'content_types' => ['article'],
|
||||||
] + parent::defaultConfiguration();
|
] + parent::defaultConfiguration();
|
||||||
|
|||||||
Reference in New Issue
Block a user