How to call twig template for particular block?

Created on 20 September 2021, about 3 years ago
Updated 3 February 2023, almost 2 years ago

I have creating template for particular block. Naming convention of particular block is block--[module|--[delta].html.twig.

How to get module name of core block that is used in naming convention of "block template".

💬 Support request
Status

Active

Version

1.0

Component

Documentation

Created by

🇮🇳India sandeep_singh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India rachit_gupta1

    Please create block template for example:-
    function yourthemename_theme_suggestions_block_alter(array &$suggestions, array $variables) {
    if (isset($variables['elements']['content']['#block_content'])) {
    array_splice($suggestions, 1, 0, 'block__bundle__' . $variables['elements']['content']['#block_content']->bundle());
    }
    }
    File name conversation
    block--bundle--banner_block.html.twig
    I hope is working.

Production build 0.71.5 2024