• Resolved jcmanlangit

    (@jcmanlangit)


    Hello good day

    Our client wants that the events page of their site be have State and/or Category (Event title) filter. I tried to add a new taxonomy for the Event State, and tried to add a custom select form, and custom pre_get_posts query, but it’s not working. What hook can we use to filter the events? It looks like the pagination and search is using ajax. So is it possible to integrate the filter to ajax also?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jes

    (@jescandoit)

    Hi @jcmanlangit

    Thanks for reaching out.

    Based on what you’re looking to do, I’d suggest reviewing our ORM documentation here:
    https://docs.theeventscalendar.com/apis/orm/query/events/examples/

    It provides a more flexible and manageable way to customize your queries. Once you’re comfortable with that, you can move forward with integrating your custom solution into an AJAX response.

    I hope this helps and let me know if you have any other questions or follow-ups.

    Thread Starter jcmanlangit

    (@jcmanlangit)

    Thanks for the reply!

    Not sure with ORM though.

    This was the code I was working on (State is a new custom taxonomy)
    https://imgur.com/a/w78NKNa
    Then add select for State
    https://imgur.com/a/oSCYgEP

    But this won’t work because of the loop in $events variable https://imgur.com/a/Rm4DWzK (that is in src\views\v2\list.php)

    May we know what controls the query of the $events variable? What file can the code be located that controls the query? Is there a hook we can use to control the query of the $events variable for the filter?

    Or is there another way to code the custom filter we want to implement?

    Thanks!

    • This reply was modified 9 months, 3 weeks ago by jcmanlangit.
    Plugin Support tristan083

    (@tristan083)

    Hi @jcmanlangit ,

    Thank you for your message.

    The $events variable in src\views\v2\list.php is a template (see The Events Calendar Template Files) variable. I recommend reviewing the following files related to the template file in question:

    • src\Tribe\Views\V2\Views\List_View.php
    • src\Tribe\Views\V2\View.php

    I’d like to note that what you’re trying to accomplish here falls outside of our scope of support.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It seems we haven’t heard back from you in a while, so I’ll go ahead and close this thread for now. If you still need help, feel free to reopen it or start a new one—our team is always here to assist!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom Filter for Events’ is closed to new replies.