Hide Token Field when the value data is empty

Created on 21 January 2018, over 7 years ago
Updated 16 March 2024, about 1 year ago

If the result value produced by a Token Field is empty the label field must not be rendered, as the core dose with other empty field.

Suppose we have:
1) Node Content Type node.a
a) A field field_a_1 attached to node.a with a Label "A_1"
2) Node Content Type node.b
a) A Filed filed_b_1 that is an entity reference to node.a
b) A Ds Token Filed filed_b_a that want to display the data into field_a_1 of node.a. To do this we use the token [node:field_b_1:entity:field_a_1] with a Label "B_A_1".

Now we have these scenario:
1)
- We have a node of type node.a called "A1" with data "FA1" for field_a_1.
- We have a node of type node.b called "B1" with data "A1" for field_b_1.
- The Display page for node "A1" will display the filed_a_1" with label "A_1" and data "FA1".
- With and without the patch we will have that the Display page for node "B1" will display the field with Label "A_1" the data "FA1".
Here every thing is ok.
2)
- We have a node of type node.a called "A2" with no data for field_a_1.
- We have a node of type node.b called "B2" with data "A2" for field_b_1.
- The Display page for node "A2" will display no filed_a_1: no label "A_1".
- Without the patch on the Display page for node "B2" will be displayed the field Label "A_1" without any data. Not ok!
- With the patch on the Display page for node "B2" will not be displayed the field Label "A_1" because no data.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇹Italy AndreaMaggi

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024