Events Made Easy Forums How do I … URL Parameters

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #60535
    Anonymous
    Inactive

    Hi,

    I was just wondering if it is possible to add a category number as a parameter on a URL, so when followed it automatically filters the events list based on that parameter?

    Or is there another way this can be done?

    I know I could just create the pages with the appropriate tags but I was just wondering if this is possible?

    Thanks,
    David.

    #60536
    Anonymous
    Inactive

    I can set the parameter using ?eme_cat_filter=18 on the end of the URL but need to know how to effectively press the search button as well!

    #60537
    Franky
    Keymaster

    And which search are you talking about? If you talk about the wordpress search, then read the FAQ about “How to add events to your wordpress search results?” at https://www.e-dynamics.be/wordpress/faq/

    #60538
    Anonymous
    Inactive

    Sorry, i wasn’t clear.

    I meant the filters on the [eme_events] page.

    I’ve got the page https://learning.necsu.nhs.uk/upcoming-events/ listing all upcoming events in a table with a category & date drop down filter & search button.

    I’d like to have a URL elsewhere on the site that links to this page but sets the category and filters it on load, without any other interaction. I can set the category no problem passing a parameter in the URL but the search button still needs to be hit.

    I was just wondering if this was possible some way?

    Thanks,
    David.

    #60539
    Franky
    Keymaster

    If you add eme_cat_filter to the url, [eme_events] automatically takes it into account.

    #60540
    Anonymous
    Inactive

    I’ve used the URL: https://learning.necsu.nhs.uk/upcoming-events/?eme_cat_filter=18 and it sets the filter in the drop down list but it doesn’t actually apply the filter, I still need to click the search button to apply the filter.

    The link above should filter the events so they’re only Microsoft Office courses.

    #60541
    Franky
    Keymaster

    It does apply, see the difference between https://learning.necsu.nhs.uk/upcoming-events/ and https://learning.necsu.nhs.uk/upcoming-events/?eme_cat_filter=18
    However: afterwards it is undetermined what would happen if you select another category. Reason: I’m using REQUEST[’eme_cat_filter’] which covers both GET and POST. But if you use the url the way you want to, it is a GET and when submitting the search it is a POST, and by default GET takes precedence in REQUEST (see also https://stackoverflow.com/questions/43157933/what-is-the-request-precedence).
    Best would be that you create a button that does a POST to https://learning.necsu.nhs.uk/upcoming-events/ (there are plugins in wordpress that help you do that).

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top