Skip Navigation

[Resolved] AJAX Pagination on view causes filter to stop working

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 3 months ago.

Assigned support staff: Nigel.

Author
Posts
#1143594
State after page load.png
State after clicking page 2.png

I am trying to:
Add an AJAX paginator to a taxonomy view that is being called from a WordPress taxonomy archive. I've created the view with a filter to "Select taxonomy terms whose parent is the current taxonomy archive." It works fine as long as I set the pagination to "Pagination enabled with manual transition and page reload". However, if I set it to "Pagination enabled with manual transition and AJAX" things seem to get wonky.

Link to a page where the issue can be seen:
hidden link

I expected to see:
That the pagination worked properly using AJAX. 🙂

Instead, I got:
Everything appears fine when the page first loads. The loop is displaying using a two-column bootstrap grid. I have it set to display only two items per page. There are currently a total of three taxonomy terms that should be displayed by this view, so it should show the paginator with two pages. It does this correctly when the page loads. However, after clicking on page 2, the paginator re-displays with six pages, and begins displaying all taxonomy terms. It seems as though the filter stops functioning after changing pages.

#1143605

I just noticed an additional oddity that I think may help narrow down what is happening. I noticed that the title above the brand images in my taxonomy view changes after clicking on the paginator. In the first screenshot, you'll notice that it says "Frito-Lay Brands". In the second one, it just says "Brands". That title is generated using a [wpv-archive-archive info="name"] to generate the brand name in front of the word "Brands". I'm guessing that this means that after clicking the paginator, the view is "forgetting" that it's on a taxonomy archive, and therefore no longer knows that it needs to filter by the taxonomy term.

#1143606

I just noticed a mistake in my last reply, and the edit function appears not to work. The shortcode that generates the title is [wpv-taxonomy-archive info="name"]. 🙂

#1143803

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Craig

I set up a local test and was able to reproduce the same issue.

I'm going to escalate it so that it can be debugged further and a solution found, and in the meantime it seems like you only option is to not use ajax for the pagination.

I'll let you know when I have some feedback.

#1148521

Thanks Nigel. I'll forego AJAX for now and wait to hear back on a solution.

#2125083

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Craig

This has been a very long time coming, but a fix for this issue with ajax has been released, and is available in the current plugin versions.

If you don't see the updates on your plugins page click the "Check for Updates" button from the custom installer page, or download the latest versions from your accounts page.

Thanks for your patience!