If-then-else conditional rewrites

Jim continued, "There are times when you'd like to display one of two different fields depending on some condition. Almost always, when we hear that a client wants to do something like this, we start planning on custom code to implement it. Many of these would be really hard to implement in Views, but some are of the form that if I have information in field X, then display it and otherwise display field Y. These kinds of requests can be handled within Views using the REWRITE RESULTS and NO RESULTS BEHAVIOR fieldsets."

No results options

"We haven't really covered the NO RESULTS BEHAVIOR fieldset, which looks similar to this when expanded:

No Results Behavior options

This is pretty straightforward. If a field is empty, ...

Get Mastering Drupal 8 Views now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.