Skip Navigation

[Gelöst] Going back in browser with AJAX pagination doesn't return to previous page

This support ticket is created vor 6 Jahre, 12 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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 11 Antworten, has 3 Stimmen.

Last updated by daveG-7 vor 6 Jahre, 11 Monate.

Assisted by: Luo Yang.

Author
Artikel
#517592

When I have a search and the pagination is set to "Pagination enabled with manual transition and AJAX", if a user goes to the next page, selects an item from the search, and then hits the back arrow in their browser, they will return to the first page of search results, instead of the expected result of returning to the page they were on in their search.

You can see that here: hidden link - Click the "Next" Button, click on one of the displayed results, then go back - you'll be back to the first page of search results, not the one you were at after hitting "Next."

Switching the pagination to "Pagination enabled with manual transition and page reload" fixes the problem, but doesn't work as smoothly as the AJAX, and so isn't as desirable.

I see that currently the AJAX isn't making any changes to the URL to indicate the page it's currently viewing - is there a way to make it do so, so going back would return to the same page?

Thanks.

#517707

Minesh
Supporter

Languages: Englisch (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I followed the exact steps you mentioned in your post and then tried to click on back and its working fine.

It seems you already found the solution and set the browser history management settings "Update URLs after loading search results".

#517968

Oh, sorry, that's my fault. After opening this thread, I switched the pagination type for all the searches on the site to "Pagination enabled with manual transition and page reload" at the client's request (so we could get the back button to return to the correct page), but forgot that I'd told you to look at it as an example. If you'll notice, it's refreshing the page, not just the results with AJAX, when you hit the Next button.

I've switched the following search back to "Pagination enabled with manual transition and AJAX" so you can see the issue I was discussing: hidden link

Sorry again about that.

#518170

Dear Dave,

Minesh is in vacation, in your case, please try this, edit your view, in section "Pagination and Sliders Settings", under the "Browser history management", enable option "Update the URL of the page when paginating the View", and test again

#518390

Thanks. Unfortunately, under Pagination and Slider Settings the option "Update the URL of the page when paginating the View" doesn't exist, not does the "Browser History Management" section.

The closest I have is a Browser History Management section under "Custom Search Settings" - that is set to "Update URLs after loading search results." I have Views 2.3.1 which seems to be the most recent.

#518901

Thanks for the details, I assume we are talking about the "go back" button of browser, and you are using AJAX custom search and AJAX pagination settings in your view, then it is expected result: the "go back" button of browser will return to the first page of search results.

If you agree, we can take it as a feature request, our developers will evaluate it.

Currently, to fix this issue, you will need to disable all AJAX feature of views.

#519092

That's not entirely true. You can use the AJAX search feature with the "Update URLs after loading search results" option chosen and then use the back button in your browser to return to the same search options chosen. And you can use that with the "Pagination enabled with manual transition and page reload" option to achieve the desired result - however, a page reload is clunky and slow.

It seems there could be a similar "Update URLS after pagination" option that does the same thing for pagination as the above option does for search results. This is the expected behavior, and how pretty much every search works - if you click on an item in the search then go back, you should end up where you were last in the search in terms of both search options and pagination (like Google).

#519232
goback.JPG

I checked again in your website, here is the detail steps, please correct me if there is anything missing:
1) Open a new browser window, and open URL:
hidden link
2) Click "Next",
I can see the URL is same as above:
hidden link
3) In the dropdown menu "Employment Types", choose option "Full-time", the browser does not redirect, but display below URL:
hidden link
The browser button "Go back" is grey and un-clickable, see screenshot "goback.JPG"

I assume you are going to display the screenshot of step 2), can you confirm it?
If it is, there isn't such a feature of Views plugin, I need to forward it to our developers to evaluate.

#519483

That's all correct, and, really, how it should be. The back arrow would be clickable if you clicked one of the search results, say "Sauvie Island Organics Delivery Driver." Then, when you click the browser's back arrow, you'll be returned to the same search you left (with Employment Type set to "Full Time" and the results filtered.

What I want is that same functionality, but instead of with the search filters, with the pagination (the "Next" button). So, if I clicked next, the URL would change but the page wouldn't reload, and then if I clicked one of the results, I could click back in the browser and return to the same place in the search results pagination.

I do believe that this is something that your developers will have to add, but think it will be something very similar to the "Update URLs after loading search results" option to search results, but for pagination.

#519667

Yes, there does exist the option "Update URLs after loading search results" for custom search and Pagination, please try this:
Edit the problem view, in section "Pagination and Sliders Settings", enable option "Pagination enabled with manual transition and AJAX" or "agination enabled with automatic AJAX transition", click button "Advanced options ", "under the "Browser history management", you should be able to see the option "Update the URL of the page when paginating the View".
But even if you enable the option "Update the URL of the page when paginating the View", the "Go back" button does not work as you expected. so there isn't such a feature within Views plugin. Can you confirm it?

#519909
Screen Shot 2017-05-03 at 9.50.34 AM.png

I'm still not seeing that option. I have Views 2.3.1 - see attached screenshot for the options I see when I select "Pagination enabled with manual transition and AJAX" and then open the "Advanced Options" section. I don't see "Update the URL of the page when paginating the View".

#520048
GO-BACK.JPG

Yes, I am using Views plugin 2.3.1 too, but can not duplicate same problem, see screenshot:
go back.JPG, if you still need assistance for it, please provide a test site with same problem, I can setup a demo for you

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.