Views token: field not displayed

Created on 25 February 2025, about 1 month ago

Problem/Motivation

In a table view, I have a content entity type with an image field and an icon field.

I want to display a column that will show the image if present or fallback to the icon if present.

When displaying field individually it is ok.

But if I set a custom text and set content to:

{% if image__target_id %}
image
  {{ image__target_id }}
{% else %}
icon
  {{ field_icon }}
{% endif %}

Then field_icon outputs nothing, because I see the text "icon" in the view output.

Proposed resolution

I wonder if there is something to do on Views integration or in the field.

Remaining tasks

Feature request
Status

Active

Version

1.0

Component

UI Icons Field

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024