N
N
noteblock2019-06-25 15:54:59
Drupal
noteblock, 2019-06-25 15:54:59

How to display drupal 8 blocks?

With a little delay , I'm switching from 7 to 8 :)
When developing on drupal, I abandoned the idea of ​​​​regions, most often using one region (Content), I collect pages mainly on templates, because. in most cases, there are 10-15 custom layouts per site and using regions in this case, in my opinion, is not the best (flexible) idea.
Question: how to display blocks in templates correctly ?
An example of what I want to achieve:

<div class="projects">
  <h2>Проекты</h2>
 {{ вывод_конфигурируемого_блока }}
</div>

PS I tried to display blocks through drupal_entity from the Twig Tweak module, but this function gives the contents of the block without links to edit it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
noteblock, 2019-07-02
@noteblock

upd. Problem solved, this is how it works:

{{ drupal_entity('block', 'phone', null, null, false) }}

A
andead, 2019-06-25
@andead

{{ drupal_block('system_branding_block') }}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question