openeuropa / oe_whitelabel

European Union Public License 1.2
2 stars 4 forks source link

Empty div with margin in Banner when paragraph has no title #302

Closed kp77 closed 2 months ago

kp77 commented 3 months ago

Problem

The Banner paragraph type's Title field is not required. When the field is left empty, there is an empty div with some bottom margin in the output.

Tested on version 1.8.0

oe_whitelabel_banner_paragraph_without_title

Reason

The banner paragraph template passes the title as the field render array, that is not null when the field is empty (contains cache metadata for example).

Proposed solution

If the Title field is empty, null should be passed as pattern title. This can be achieved by using field_value filter.

{{ pattern('banner', {
  'variant': variant,
  'title': content.field_oe_title|field_value,