Mods to filter bar not working quite as expected

Home Forums Calendar Products Filter Bar Mods to filter bar not working quite as expected

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #1158549
    Ruth
    Participant

    Hi there

    I received some excellent assistance in another thread (https://theeventscalendar.com/support/forums/topic/hide-event-category-from-events-page-again/) and it appeared to address all my requests.

    We have effectively created two events pages: one for workshops run by the client with tickets sold via the website (main events page with “community” category hidden) and the other as a community events page with no tickets sold via the website (“community” category archive page).

    The filter bar has been modified to only display the category and sub-categories relevant to either the main events page or the “community” events page. This works fine on the main events page and when a sub-category is selected from the filter bar, results are returned (or not) as expected.

    However, on the “community” events page, selecting a sub-category returns no results and simultaneously switches back to the main events page, meaning the filter bar then only shows the category and sub-categories for the main events page (ie. not “community”). Firstly, selecting some sub-categories on the community events page should definitely return results, as I know there are events in those sub-categories. Secondly, if there is a case of no results being returned, the user should remain on the “community” events category archive page, so they can re-select an alternative sub-category of “community” from the filter bar.

    This is hard to describe. Here are the links to the two different events pages:

    http://southernharvest.org.au/events/

    http://southernharvest.org.au/events/category/community/

    Hopefully you will understand what I’m trying to say by using the filter bar on both of those pages.

    Thank you
    Kate

    #1158550
    Ruth
    Participant

    Sorry… I forgot to mention:

    Also, when viewing the “community” events category archive page, after clicking the “next events” link to view more events, it then also returns a “no results found” message and switches back to the main events page, including the filtering for that page. There are definitely more events to view after the first page.

    Thanks
    Kate

    #1159272
    Josh
    Participant

    Hey Kate,

    Thanks for reaching out to us!

    To start here, I’d like to address the issue of the pagination on a default category view (the second comment above). I believe there are some elements in that issue that could get us closer on the main issue you’re describing above.

    To start, if you deactivate the filter bar on the site, does the pagination on the community category archive work again?

    Thanks!

    #1161373
    Ruth
    Participant

    Hi Josh

    Sorry for the slow response. It can take me a while to get back to these things.

    Yes, the pagination issue with the community category archive page goes away if I deactivate the filter bar plugin.

    Regards,
    Kate

    #1162032
    Josh
    Participant

    Hey Donna,

    Thanks for following up with us here and verifying that! This let’s us know that there aren’t any other issues at play here. Also, when linking directly to the paginated results for the archive (http://southernharvest.org.au/events/category/community/?tribe_paged=3) I can see that working now so, it looks like what you’re experiencing is most likely due to the previous customization.

    Can you verify that if you temporarily remove the add_filter( 'tribe_events_filter_values', 'tribe_hide_filterbar_categories', 10, 2 ); line from that customization, does the pagination work throughout the calendar again as expected?

    Thanks!

    #1162612
    Ruth
    Participant

    Hi Josh

    No, removing that line does not fix the pagination problem. Still only one page of results and clicking “next events” returns “there were no results found”.

    Kate

    #1163754
    Josh
    Participant

    Hey Kate,

    Thanks for following up with us here.

    Hmmm, definitely wasn’t expecting that here. Can you verify that the snippets within the following links are the two final customizations added to the mix on your site:

    Hide event category from events page (again)

    Hide event category from events page (again)

    If so, can you try:

    • deactivating all other plugins and switching to a default WordPress theme
    • see if the filters and pagination are working by default as expected (without the customizations you’re wanting on the site)
    • next, add back the customizations into the functions file and see if the filters and pagination are working as desired
    • If so, try switching back to your theme and see if the error you’re seeing now returns
    • If not, try reactivating your other plugins one by one to see when the error returns

    Let me know if this helps.

    Thanks!

    #1163822
    Ruth
    Participant

    Hi Josh

    The only difference is in the first snippet (post 1142662), where I changed line 11 of that snippet from this

    ‘terms’ => array(‘markets’),

    to

    ‘terms’ => array(‘community’),

    Out of interest, I changed it back to ‘markets’ and went to the Community Events page (community category archive page) to see if it fixed the pagination problem. It doesn’t.

    I also wanted to see if it had an effect on the other problem (selecting a sub-category from the filter bar and getting to results). While the ‘markets’ term was in play, selecting the “dining” sub-category returned events in that category AND ALSO returned the user to the main events page, with only the workshops category and sub-categories available in the filter bar.

    Re-entering ‘community’ put me back where I started with the problems I first came to you with. Hope that makes sense.

    Could you please advise if this information helps before I start fiddling around with changing the theme etc? The site is live and I’d rather not make drastic changes unless I absolutely have to.

    Many thanks
    Kate

    #1164529
    Josh
    Participant

    Hey Donna,

    To completely remove the impact of that custom code, try removing both:

    
    add_action( 'pre_get_posts', 'exclude_events_category' );
    

    and

    
    add_filter( 'tribe_events_filter_values', 'tribe_hide_filterbar_categories', 10, 2 );
    

    From your code and test then. This will completely remove the impact of those snippets from your site and will let us see if the Filter Bar is working on it’s own within your current environment properly.

    Thanks!

    #1164895
    Ruth
    Participant

    Hi Josh

    Removing those two lines does this:

    * pagination on community category archive page now works, but

    * the second and subsequent pages of results still return to the main events page, although only events in the community category are displayed.

    Kate

    #1166330
    Josh
    Participant

    Hey Donna,

    Would you mind sending me the export file of the content on your site as a private reply here (Tools > Export). I want to do some further testing and having an identical category setup and number of events will help me in trying to figure out exactly what’s going on with the previous snippets and see if this is something that we’re able to iron out.

    Thanks!

    #1166698
    Ruth
    Participant

    Hi Josh

    Thank you so much for persisting with this. I really appreciate it.

    However, when I try to attach/share the export file, I get a message that I can’t upload files of this type ie. XML export file. Can I email it to you separately, perhaps?

    Kate

    #1166862
    Josh
    Participant

    Hey Donna,

    Sure thing, you could compress the file into a zip file and attach it here. If you’re on a mac, that would be right click the file and select ‘Compress “{file_name}”‘ option there.

    That should work to attach here. You could also send it to support[at]theeventscalendar.com and request the email comes to me.

    Thanks!

    #1171159
    Josh
    Participant

    Hey Donna,

    I’m terribly sorry I missed responding to this here. I’ve got the email with xml file I’m working on getting it set up on my local install and digging into the potential issues here.

    I’m thinking the root of the issue here is associated with ajax requests loading the different screens and some of the original filters applied to the filter bar displays not persisting once those requests are made. If that’s the case, that is an additional level of complexity here that I’m not positive I’ll be able to provide a couple of snippets for to overcome. But, I’ll take a look to see if there is something that I can see that would work here.

    Thanks!

    #1176348
    Ruth
    Participant

    Hi Josh. Just wondering if you’ve had any time to look at this and if what you suspect is true. Thanks. Kate

Viewing 15 posts - 1 through 15 (of 18 total)
  • The topic ‘Mods to filter bar not working quite as expected’ is closed to new replies.