How to display a custom block in a view twig file? I added a custom block in the header of a view, and I am trying to get it to display. The block contains social media icons and links.
If I want to add a custom text area, I can use this code -
{{ view.header.area.options.content.value }}
In my kint I see this for the block I added -
      &quot;header&quot; =&gt; array:3 [▼
          &quot;entity_block&quot; =&gt; array:12 [▼
            &quot;id&quot; =&gt; &quot;entity_block&quot;
            &quot;table&quot; =&gt; &quot;views&quot;
            &quot;field&quot; =&gt; &quot;entity_block&quot;
            &quot;relationship&quot; =&gt; &quot;none&quot;
            &quot;group_type&quot; =&gt; &quot;group&quot;
            &quot;admin_label&quot; =&gt; &quot;&quot;
            &quot;empty&quot; =&gt; true
            &quot;tokenize&quot; =&gt; false
            &quot;target&quot; =&gt; &quot;socialicons&quot;
            &quot;view_mode&quot; =&gt; &quot;default&quot;
            &quot;bypass_access&quot; =&gt; false
            &quot;plugin_id&quot; =&gt; &quot;entity&quot;
          ]

So I tried to do  {{ view.header.entity_block }} but I get an error -
Exception: Object of type Drupal\views\Plugin\views\area\Entity cannot be printed. in Drupal\Core\Template\TwigExtension-&gt;escapeFilter() (line 425 of core/lib/Drupal/Core/Template/TwigExtension.php). 
What can I do to display the block?
You probably are confusing {{ header }} and {{ view.header }}.
The first prints the header section including the block:
views-view.html.twig
{{ header }}

The second one returns ViewExecutable::$header, an array of handler plugins you have configured in the View. You can try to extract configured string values like in the first example but in case of a block entity you probably only find the block id and you have to load and render the block yourself. It would be much easier though to print {{ header }}.