This module enables a view to output a field if another field is empty.

You need Views If Empty when

You have a content type with an embedded video and an imagefield thumbnail. The nodes always have the images but occasionally have a video. You want your view to display the image field when the video field is empty, display the video field when available, and never display both.

Installation & Usage

Install normally. Add or edit a view where the row style utilizes fields, and add a Views If Empty field.

In the options form for the Views If Empty field, select the 'If this field is empty' field. This is the field that is checked whether it is empty or not. (In the above example, this would be the video field.)

Next, select the 'Then output this field' field. This is the field that is output when the empty field is empty. (In the above example, this would be the image field.)

Usage Hints & Tips

The order of the fields in the view will affect the Views If Empty field. It will only allow selections from fields that come before the Views If Empty field.

It might also be important to mark both the empty field and output field to be "excluded" via their option forms. Otherwise, you may see some duplicate content in your view results.

Project Information

Downloads