• Resolved kruge

    (@kruge)


    (it’s just about the events on that page, ignore the resource-search below)

    Hi there!

    I’ trying to find out how to get Events manager to show me search results with the filters being filled via url-parameters.

    Take the Link “I need help with” and add for example: ?country=DE&category=33

    (…/events/?country=DE&category=33)

    This will load the events page with the country and the brand of choice already selected in the search box – but the results below are still the unfiltered results – only when I click “submit” I will then be sent to the results.

    Isn’t it possible to get the results from a URL with added parameters directly?
    Am I missing something? ??

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Nope… EM is not designed to “listen” for URL parameters for a search result. You would need some custom coding to achieve that.

    Thread Starter kruge

    (@kruge)

    Hrm. Do you KNOW that for SURE?

    If so: Why not? ?? I mean: for me it’s a normal thing to send ppl a url to some search results and similar things – under which this imo also would fall… And why else if not for that functionality can I set the filters via the URL?

    Okay, so just assuming you’re right… Hmmm… Custom coding wouldn’t be a problem in *general*, I already did some changes in the plugin directly that didn’t work with theme-overrides and thus have removed the EM from the update-loop already… Why not make some more changes?

    Anyone got any idea where to start even?

    Because it was NOT designed THAT way.

    Thread Starter kruge

    (@kruge)

    Okay, so just assuming you’re right… Hmmm… Custom coding wouldn’t be a problem in *general*, I already did some changes in the plugin directly that didn’t work with theme-overrides and thus have removed the EM from the update-loop already… Why not make some more changes?

    Anyone got any idea where to start even?

    Hello,

    Sorry, Just to confirm what you’re trying to achieve is to have some URL pre-set-up search results with Filters? So people or anyone could send it and have pre-filtered results? If this is correct, you would need to do some custom coding to Achieve it. Currently, We’re very limited to custom coding.

    Thread Starter kruge

    (@kruge)

    Yupp, that’s exactly what I need.

    As I wrote above: When I add parameters to the URL they will indeed be taken as selections …/events/?country=DE&category=33 – only the list below still shows the un-filtered results until I then press “submit”.

    If you could, perhaps, point me in the right direction as to where the results are compiled and filtered in the scripts that’d be a great help – I think I might be able to take it from there. ^^ Can’t be that complicated, right?

    Should I be successful I’d happily share the solution too if you like. ??

    Thread Starter kruge

    (@kruge)

    Oh, sweet – that was easy-peasy. ??

    in events-list.php I simply added 4 lines:

    $args = apply_filters('em_content_events_args', $args); //Original line
    $company = $_GET["category"];
    $country = $_GET["country"];
    if($company != "") {$args[category] = $company;};
    if($country != "") {$args[country] = $country;};

    Now if there’s url parameters for country or company these will get used when the actual list gets called, otherwise it’ll go ahead as usual.

    Now while this clearly is NOT a universal solution (it looks for “MY” parameters and nothing else) – should someone need an easy and quick way for their events search to react to url parameters it should be obvious how to adapt my solution. ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Trigger events filter/search with URL parameters?’ is closed to new replies.