Drupal Views Entity Reference Context -


i'm running drupal 7 entity reference , organic groups. have 2 content types, 1 of group , other group content. have entity reference field (select list) references group content associated group.

i want create view shows value of field selected entity reference field in group content type.

for instance:

 team: red sox  location: fenway 

location content type (group content) , team group. there many teams , many locations when i'm looking @ group page want view shows single location (the 1 selected in group content type).

after research realized views , context can't handle on own. ended using view php construct filter filtered out other results 1 wanted:

$node = menu_get_object(); $item = field_get_items('node', $node, 'field_name'); $loc = $item[0]['target_id']; $refnode = node_load($loc); $primary = $refnode->title; if ($primary != $row->title) {   return true; } 

you're welcome 1 :) if has better suggestions on how code feel free comment or post alternate solutions.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -