Problem/Motivation

The region.html.twig's content is markup, so one solution to partially rendering the content of the region would be to rely on elements renderable array.

However, without filter doesn't work in this case, the entire content is printed anyway.
Inspecting the filtered array shows that the removed elements aren't actually there.

Steps to reproduce

Inside region.html.twig try to print elements partially, e.g.

{{ elements|without('bartik_content') }}

bartik_content shouldn't be printed, but actually it is.

On the contrary, ispecting the variable, e.g.

{{ dd(elements|without('bartik_content')) }}

the dump shows the array doesn't contain bartik_content

Comments

Giuseppe87 created an issue. See original summary.

idebr’s picture

Hi Giuseppe87,

This is being fixed in #3178202: Render blocks later, so they can be placed individually in a region template. I'll close this issue as a duplicate, so we can focus our efforts in the related issue.

giuseppe87’s picture

Thank you, I searched for related issues but didn't find that.

Probably the scope of this is kinda different (why without doesn't work on elements of region?) but if the #3178202 provides a content that can be manipulated, that will even a better solution.

marcvangend’s picture

Meanwhile, #3178202: Render blocks later, so they can be placed individually in a region template was RTBC, but it's back to Needs Review because of the tests that were added. If this matters to you (indeed @Giuseppe87, it provides a content that can be manipulated) please help review it so we can get it committed.