drupal-7drupal-viewsdrupal-contextual-filters

Drupal 7, if contextual filter 'default value' not there, ignore it


The answer might be very simple but I can not find any solution to it.

I have a view with contextual filter for Nid with default value set to 'current node ID'. The block yields correct results when were are on /node/5 which has results. However, I want the block shows ALL results (remove the filter?!) when the block is placed on the or somewhere where 'node ID' is not available.


Solution

  • There is an option of validations when the filter value is not available. You can choose the first option of Display all results for the specified field.

    enter image description here