0

I'm trying to display relationship field "members" from selected "events" if their "field" value matches a certain "query":

{ev_members status="open|other"}
    {if get:f}
        {if ev_members:{get:f} *= '{get:q}'}
            {ev_members:entry_id}|
        {/if}
    {if:else}
        {ev_members:entry_id}|
    {/if}
{/ev_members}

I'm using URL querys so, {get:f} is the field searched on and {get:q} is the query

e.g.

{if ev_members:organisation_name *= 'Oxford|Cambridge|Oxbridge'}

I've tried pipes, commas, spaces, and encoded pipes, commas and spaces, but nothing works. this works fine if using a single value though.

I saw another thread with a very similar issue, but the solution was an addon for an earlier vers of expressionengine, so won't work here unfortunately.

thanks

1 Answer 1

0

I was able to find a solution

I'm using stash, and I was getting this info via an ajax call.

My ajax data output template is in an embed from a 'filter' template, I use this to set some stash vars and filter ajax calls depending on URL.

The result is essentially a 'Report'

The report is also an entry, in which I have stored the "event" entry_ids, ({embed:em_event_ids})

I set a var of all the "event" IDs I'd like to build a 'report' on

{exp:stash:set name="event_refs"}{!-- 
--}{exp:channel:entries
        channel="events"
        entry_id="{embed:em_event_ids}"
        other_params...
    }{f_event_ref}{if count != total_results}|{/if}{/exp:channel:entries}{/exp:stash:set}

I then use the event_refs var to filter the "members" of those "events" (in the same template file:)

{exp:channel:entries
channel="members"
search:f_event_refs="{exp:stash:event_refs}"
{if get:f}search:{get:f}="{get:q}"{/if}
other_params...
}{entry_id}{if count != total_results}|{/if}{/exp:channel:entries}

Doing it this way, the query with pipes ({get:q}), works as searching for multiple values

The data output is then what is used on the page making the ajax call

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.