1. Contextual filter "Has taxonomy term by ID"
  2. Filter is set to "Provide default value" > "Type: PHP Code"
  3. The PHP code resolves in most cases, but on some pages it shouldn't. In those cases I'd like to do what Views does when you choose the "Display all results for the specified field" option.

Is there something my PHP code can pass back to Views that will cause it to display all results?

(Or even 'Display contents of "No results found"' because then I could use a View inside there)

Config: Views 3, D7

  • did you try views PHP module?
    – monymirza
    Nov 16 '12 at 4:37

when you want to show all then

return "all";


  • how this works?
    – monymirza
    Nov 16 '12 at 4:36
  • I don't have access to this site anymore to test it - will be curious to hear if this solution works. Would be sweet if it does! Nov 29 '12 at 21:49
  • 1
    @JoshuaStewardson it does work for me
    – user11312
    Jul 1 '13 at 0:09

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.