Skip Navigation

[Resolved] URl Not Changing on Pagination / Site Visitors Can't go Back to Previous Search

This support ticket is created 4 years, 10 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by Caitlin 4 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1744483

Hello,

What I'm trying to resolve is when site visitors navigate to page 4 of 20 for example in the listings view and then click a listing to view details (i.e. custom post type) then click the BACK button in their browser what I expect is that they go back to page 4 of 20 – where they left off. But instead they are taken back to page 1 of the listings view. And when it takes you back to page 1, the pagination at the bottom shows the wrong page #; if you were on page 4 then is says page 4 even though the results loaded page 1.

I've read in the forums that enabling the "Browser History Management" should help, which I've enabled under the individual settings and under the Toolset Settings. But my URL doesn't show any parameters at all. I assume some of my other settings are not correct and that's why it's not working. However, if there is another way to solve my issue, so that site visitors are taken back to where they left off in their browsing/searching please let me know.

I'm happy to share credentials for you to access the WordPress dashboard as well, if needed. Thanks.

#1744523

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Caitlin,

Thank you for getting in touch.

Can you let me know how your view was built ? Was it build using the block editor by going to a Page and creating a new Page then using the View block to create a new view ?

Or was it done by going to Toolset -> Views -> Add New.

Either way the steps should be similar:

A. If you've created your view using the view block, you will need to use the Block navigator at the top left of your editor. Then select your Pagination. From there a sidebar for the block should open to the right. You will need to scroll down to the "View Pagination Settings" and expand the accordion for the section. If you have "Pagination enabled with manual transition and AJAX" then you should see a few other options including "Browser History Management". Ensure that "Update the URL of the page when paginating the View" is selected.

B. If you've created your view using the classic method by going to Toolset -> Views. From here you will need to edit your view and scroll to the "Pagination and Sliders Settings" ensuring that "Pagination enabled with manual transition and AJAX" is selected. Finally under "Browser history management" ensure that both options are selected.

Please do these checks and let me know.

Thanks,
Shane

#1744531
Screen Shot 2020-08-19 at 10.44.22 AM.png
Screen Shot 2020-08-19 at 10.42.56 AM.png

Shane,

Yes, I've enabled it under the View settings and under the Settings > Front-End Content section. See screenshots. But my URL is still remaining the same when paging through.

#1744551

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Caitlin,

Thank you for confirming.

Can you allow me to have admin access to the website so that I can have a look at this for you ?

Also please provide me with a link to the page where the view is being displayed. I've enabled the private fields for your next response.

Thanks,
Shane

#1745857

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Caitlin,

I've checked and saw that it is in face the Pagination URL Parameter is not getting added.

At this point I cannot be sure what is the cause of the issue because further testing needs to be done. Given that this is a live site I would like to grab a copy using the duplicator plugin.

From there I can setup a local copy of the site and perform further testing. This can help to eliminate the server being the issue.

Thanks,
Shane

#1745859

Shane,

That's not a problem, please feel free to move forward with making a copy for further testing. Thank you for your help!

#1745863

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Caitlin,

I have a little bit of Good news for you and a bit of bad.

The Good news is that if you create a completely new view and remake it and test the pagination as you go along it works fine.

You old view still doesn't work. This leads me to suspect the view itself being the culprit given that the new view I made works even when I copied a few components from the old view.

Please try doing this on your end and let me know if the results are the same.

Thanks,
Shane

#1748747

Shane,

That worked. I tried rebuilding the view and determined that the issue was related to a JS code I had input to make the page scroll to top after pagination. I found the information for this JS in the Toolset forum: https://toolset.com/forums/topic/scroll-to-top-after-ajax-pagination/

Since I've had to remove the JS, I still need to find a way to have the page scroll back to top after pagination - especially on mobile. Can you advise on why the above didn't work or if there is another solution? I'm not sure if I had the code in the wrong place or if there is a different issue with it.

Thanks!

#1748837

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-08-21 at 12.53.58 PM.png

Hi Caitlin,

Without changing the code all you need to do is to remove it from the section here. See Screenshot

The function was already wrapped in the callback function for the pagination and you've already added it to the JS section of your view so no need to have it here again.

This should fix it now while maintaining the custom code functionality.

I've also tested this in the duplicate of your website so it should also work for you.

Thanks,
Shane

#1748885

Everything is resolved now. Thank you for all your help!