How to show nodes of a content type using contextual filters as filters?
Solutions
After hours of tinkering here is my solution to the above. If anyone has the same requirement this will help:
Drupal 7.16, views-7.x-3.5
The View Setup :
The result (sample 1):
Sample 2:
No other settings required. Even in the section "WHEN THE FILTER VALUE IS NOT IN THE URL" does not matter, what seems to be important is you set the validation to always return TRUE regardless.
The path of this view is set to /myreports/%
Perhaps, the filter value in the URL that was found will be validated to always true. Then resolves to using this as a normal filter, as is the case with the normal filter setting. Hence, Filter content type = events (or jobs).
The problem with the previous solution is that it will not work for Content Types that have more than one name such as "Press Releases". This worked for me
- For Context Filter, select Content Type.
- Select "Provide Default Value" and select "PHP Code".
Enter the following snippet of code:
$node = node_load(arg(1)); echo $node->type;