M
M
Maxim2017-05-24 07:02:38
Drupal
Maxim, 2017-05-24 07:02:38

How to override custom block in drupal 8?

Please tell me how to correctly name the block template in order to override the custom block.
Created a custom block and wrote 1 word.
Created a block--block--6.html.twig block in my sub-theme in the templates/block/ folder. Refreshed
the page, cleared all the caches - nothing.
What could I have done wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
afi13, 2017-05-24
@MToUCH

Good afternoon,
I advise you to enable debug mode for templates. This mode will display as HTML comments where the output of each template starts and ends, and will indicate any variations of template names to override. After that, it will be enough for you to simply copy the name and rename the desired template.
To do this, you need to update the sites/default/services.yml file:

parameters:
  twig.config:
    debug: true

More details can be found here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question