Solved

Conditional filed in Drupal views

Posted on 2011-09-14
3
242 Views
Last Modified: 2012-05-12
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?
0
Comment
Question by:jiiins2
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
h4hardy earned 500 total points
ID: 36540915
0
 

Author Comment

by:jiiins2
ID: 36541065
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?
0
 

Author Comment

by:jiiins2
ID: 36541281
Never mind, I got it.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to properly use session_regenerate_id when user logs in 7 40
PHP populating an array. 4 25
PHP AJAX JSON 2 61
PHP curl issue VERBOSE output 18 44
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question