How to add suggestions of block templates for block type in Drupal 8 and Drupal 9
Drupal 8 and Drupal 9 add suggestions of block templates for the different block types by using the hook_theme_suggestions_block_alter() function in the .theme file.
For example, if you want to create a block template for a specific type like block--bundle--machine_name_of_block_type.html.twig. For basic block type naming convention will be block--bundle--basic.html.twig. For banner block type naming convention will be block--bundle--banner.html.twig.
For example, if you want to create a block template for a specific type like block--bundle--machine_name_of_block_type.html.twig. For basic block type naming convention will be block--bundle--basic.html.twig. For banner block type naming convention will be block--bundle--banner.html.twig.
Share
share your add link
https%3A%2F%2Fmycode.blog%2Flakshmi%2Fhow-add-suggestions-block-templates-block-type-drupal-8-and-drupal-9%0A
Share in social
Comments