Skip Navigation

[Resolved] AJAX pagination does not work in same page with multiple views

This thread is resolved. Here is a description of the problem and solution.

Problem:

When put the same AJAX pagination view into the same page multiple times, the AJAX pagination works only in first view instance, other view instances AJAX pagination don’t work.

Solution:

It is a known bug, currently, you can add shortcode attribute to views shortcode, for example:

https://toolset.com/forums/topic/ajax-pagination-does-not-work-in-same-page-with-multiple-views/#post-1149732

It will setup each "banner-ad-leaderboard" instance as an unique instance in the same page.

Relevant Documentation:

This support ticket is created 5 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Our next available supporter will start replying to tickets in about 3.66 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 5 years, 12 months ago.

Assisted by: Luo Yang.

Author
Posts
#1149680

Hi Luo,


I assume you are going to display the ADs as below:
First banner place, display "Banner Ads" post A
Second banner place, display another different "Banner Ads" post B
...

No, your assumption above is incorrect.

The "Banner Ad - Leaderboard" view is set to fade between the 'posts' (images), similar to an image slider. The same "Banner Ad - Leaderboard" view is then set to be displayed every x many Adventure posts by the

[wpv-item index=split5]

shortcode.

The first rendering in the fron-end, of the "Banner Ad - Leaderboard" view, fades through each image (page) in the "Banner Ads" CPT.

The following "Banner Ad - Leaderboard" views don't fade between the images (posts) in the "Banner Ads" CPT. This is the issue I'm asking about.

The "Banner Ad - Leaderboard" view ordering is 'Last Modified' - not random.

The "Banner Ad - Leaderboard" - 'Pagination' is AJAX + 'Pre-load 10 pages. I don't expect to ever have more than 10 "Banner Ads" CPT posts (images). So was looking to there only every being one query in the "Banner Ad - Leaderboard" view loop.

Hope this clarifies the query.

#1149682

Thanks for the clarification, I can duplicate the same problem in my localhost, and have escalated it, will update here if there is any news.

As a workaround, you can integrate other Jquery slider framework, for example:
1) Edit post view "Banner Ad - Leaderboard", disable AJAX pagination, and output all ADs posts
2) Integrate flex-slider, see similar thread:
https://toolset.com/forums/topic/how-to-display-the-pics-i-uploaded-as-a-slider/#post-518295
More help:
hidden link

#1149732

Here is feedback from our 2nd tier supporters:
It is a known bug, which is in our to-do list of Views plugin version 2.7.

Currently, you can try this:
Edit the view "Air Adventures":
hidden link

in section "Loop Editor", change the view shortcode from:

[wpv-view name="banner-ad-leaderboard"]

To:

[wpv-view name="banner-ad-leaderboard" test="[wpv-post-id]"]

Add a shortcode attribute "test", It will setup each "banner-ad-leaderboard" instance as an unique instance in the same page.

Please test again, check if it is fixed.

#1149782

My issue is resolved now. Thank you!

Will I need to remove the 'test' attribute when the fix is rolled out?

#1149786

No, you don't need to remove the 'test' attribute, it won't take effect on Views result, it can only make the view as an unique item in the same page.