Link to home
Start Free TrialLog in
Avatar of jiiins2
jiiins2

asked on

Conditional filed in Drupal views

In a view, the output for a field is rewritten as follows:
<div class="company-profile-title">Contact Person:</div>
<div class="company-profile-data">[field_up_oi2_contact_name_value]</div>

Open in new window


I need to make it so that if [field_up_oi2_contact_name_value] is empty, then [field_up_oi1_ceo_name_value] is displayed instead.

How can I achieve that?
ASKER CERTIFIED SOLUTION
Avatar of h4hardy
h4hardy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jiiins2
jiiins2

ASKER

Thanks, I just found "conditional fields" and it works just nice. My problem now is that the view doesn't have all the fields I need, i.e. $data missing something. Do you know by chance how to modify the query that populates $data?
Avatar of jiiins2

ASKER

Never mind, I got it.