Contextual filter on entity reference field in indexed view I have two pages: jobs and offices.

My jobs page is an indexed view (with Search API) which displays jobs that have an entity reference field to the office it belongs to.

I want to put a link on my office page that links to the job page which only shows the jobs belonging to that particular office.

I've followed a few examples but none of them seem to work with my indexed view. Has somebody done something similar?

This is what I did: https://www.drupal.org/node/1841004 but it doesn't seem to work.

Thanks!
If you want to show the jobs for that particular office on your job page, you might want to use a parameter. you need to pass the nid of that office to the url.

Create a link similar to this:

  $nid = arg(1);
&lt;?php 
    $l = l( t('More Jobs'), 'list-of-jobs',   array('query' =&gt; array('field_office' =&gt; $nid)  ));
    echo $l; 
        ?&gt;


your entity reference field is "office" right? use that field for your contextual filter. then use Views Contextual Filter Query module to get the parameter from the URL. In my example, it's field_office. 

Hope this helps!