1

On my content type, I have a boolean field which consists of a single on/off checkbox.

I have created a view, which shows all the nodes of that content type. However, I only want the view to show nodes where the boolean field has been ticked. How can I do this?

I thought in Views I could use "Filter criteria > Content: [Name of Field]."
However, when I select this, the only option available is "Select All". If I select this, I get the following error message:

No valid values found on filter: Content: Show on Main Navigation.

What am I doing wrong?

2 Answers 2

4

I tried on my test site, and it happened to me too, for the simple fact I didn't enter any value for On value, and Off value. Once I entered Show the node in the view, and Don't show the node in the view, for those fields, the filtered criteria showed those values in Options.

screenshot

If you don't enter any value for On value, and Off value, the Options fields really shows three entries, but the other two are empty strings. They are there, but you cannot see them, and you don't know which value comes first. Is the first row for On value, or Off value?

screenshot

2
  • Thanks! The values were there (like you said) but when I selected them I got an error message saying that the values were invalid. I went back to my field and added '1' as the on value and '0' as the off value. The values then appeared in the view and the error message disappeared.
    – big_smile
    Dec 19, 2012 at 5:58
  • Even if the Views module would not cause an error, it would be quite difficult to remember if the view shows the nodes for which the field is selected, or no. :) I must say it is not that intuitive; I happened to resolve it because I didn't want to use the default values suggested for the On value, and Off value fields.
    – apaderno
    Dec 19, 2012 at 6:01
0

I think in the filter criteria you can set the operator manually. See the attached screenshot.enter image description here

1
  • 1
    The problem is not for the Operator field, but with the Options field. For a boolean field, then, the Operator field doesn't contain any of those options.
    – apaderno
    Dec 19, 2012 at 5:04

Your Answer

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

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