I have a content type which I'm displaying in a view. The view displays 'teasers'. The teaser display uses display suite 2-col layout. I have overridden the template, which has 4 regions:
top; first; second and bottom.

this is the alteration I've made to the 'bottom' region of the template:

{% if content.bottom %}

This should be invisible, unless fields in the 'bottom' region have content.
{{ content.bottom }}

{% endif %}

The issue is that the h1 tag above is ALWAYS RENDERED! I repeated the same thing above with another content type and view; same outcome.
I tried to kint content.bottom, instead of getting NULL, it simply didn't display.
I tried kint(content) and got an out of memory error (with 1024 MB!) - I doubled it and the page rendered without kint output.
I replaced the above conditional statement with the following:

{% if content.field_in_bottom_region %}

This is weird sh*t
{{ content.field_in_bottom_region }}

{% endif %}

Again, the SAME OUTCOME: the header rendered for every node in the view, regardless of whether the field existed or not.

I have now abandoned templating for this (time pressure) and instead I reconfigured the view to get the desired markup. But since this may be a serious bug, I thought I'd post it here.

I'm using Drupal Core 8.3.5

Comments

rominronin created an issue. See original summary.

swentel’s picture

Priority: Critical » Normal
Status: Active » Closed (duplicate)

This is not a DS problem per se, the whole of core suffers from it.

#953034: [meta] Themes improperly check renderable arrays when determining visibility