Solved

Conditional filed in Drupal views

Posted on 2011-09-14
3
230 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
Comment Utility
0
 

Author Comment

by:jiiins2
Comment Utility
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
Comment Utility
Never mind, I got it.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now