Question

I'm running Drupal 7 with Organic Groups. I cloned the "OG all user group content" view added an Entity Reference to it to be used as a field in one of my content types. My question is:

How can I use an additional contextual filter (Content Type) so that I can add an Argument to the Entity Reference field?

Entering the content type name isn't working: 1/article for example.

Was it helpful?

Solution

So I got the answer from:

https://drupal.stackexchange.com/questions/53861/how-to-show-nodes-of-a-content-type-using-contextual-filters-as-filters

Adding "Content Type" contextually typically requires a Node ID however; using PHP Code you can simply add:

return TRUE;

and this will allow you to enter the content type name (the physical name; i.e. OpenLayers Location field is named Location but the physical path is ol_locator_location).

OTHER TIPS

When you edit the view in the Advanced link, you can see "Contextual Filter"; there you can add the field you added to the content type.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top