2

A view I'm working on has a linked Title field. By default, this field should link to an internal page with the [nid]. E.g. http://www.example.com/node/[nid]

However, there is a second link field where, if filled in, the link should be re-written to go to the specified link.

So, if the link field is blank, link to a URL with the [nid]. If the link field is filled in, link to the specified URL. I'm unsure of how to have a default behavior and then override it.

How could I accomplish something like this from within Views? Thank you!

1

Views Conditional module, can help you.

Views Conditional is a simple module that allows you to define conditionals (if xxx then yyy) with fields in views. Conditions include:

Equal To Not Equal To Greater Than Less Than Empty Not Empty Views conditional allows you to output text based on the result of the condition.

Example screenshots

  1. Added Fields in view

enter image description here

  1. Views Conditional Field configuration

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.