0

I have two fields in my content type. State and test . State have two values active and inactive and test is a boolean field.

I want to display the content of this content type using views which will display:

active content
inactive content if test is FALSE

How can I do this in views?

I tried with views filter groups and it generates this condition.

WHERE ((( (node.status = '1') AND (node.type IN  ('mycontnt')) AND (state = 'active') )OR( (state = '4') AND (test = '0') )))

But this is not displaying the correct content as I want.

1 Answer 1

0

So far as there is no support for nested groups in Drupal 7, we shoud do it slight differently.

Join general filters (Published and Node type) in first AND group. May be we also should to add there "State IS NOT NULL" condition to exclude content with empty State field.

In second group we should place State = 'active' OR test = 'false'. This group - OR group. In the Views admin interface in would be somthing like this:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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