Score:0

Creating a view with an exposed filter for "is not empty" where all results are shown by default

de flag

I'm creating a view. By default, I want all results shown, with an exposed filter for 'has a value' (aka is not empty) and 'is empty'.

I cannot figure out how to make the exposed filter work for this. If I make the exposed filter on either 'is empty' or 'is not empty', it filters the values initially based on that section. I only want the exposed filter to take effect when the value is in the URL.

Can anyone point me how to do that?

Score:1
gb flag

You can configure your exposed filter with these configurations to show all the content in the initial state:

  • Check: Expose this filter to visitors, to allow them to change it
  • Filter type to expose: Single filter
  • Operator: Is one of
  • Selection in the RHS: Do not select anything.

Once you save this, your view should show all the results when view output is rendered, and filter the results based on the exposed filter selection.

Hope this helps.

Jaypan avatar
de flag
Thank you. It's a text field, how ever 'is one of' is one of the options.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.