Scroll Users to same location on the previous page

Continuing the discussion from How to return users to the scroll position of the previous page:

@boston85719 Here you say that send URL parameters to current page before you navigate to the new page, But we cannot have two ‘go to page’ actions in the same workflow. How can I do this?

Make a parameter for that “Go To Page” action.

have it populate the “scroll-height” (like site(dot)com/somepage?sh=103)

Then when that page loads (with another action), get that parameter and adjust the height of the new page accordingly. Then “Go To Page” again without the “sh” parameter and it’ll be like it never happened.

I think you are confused. I have a blog home page where users can scroll down to see all the blogs. When they click any one group they are taken to that page. I can pass scrolling position and all the other info to this new page.

But when user presses back button the url params of the new page are not passed to the blog home page.

You’ll need to use cookies or localstorage to accomplish this. My plugin can do this.

Ideally you’ll want to store the previous scroll height on the page, and store that in storage. When the user navigates back to the pages, look up their previous scroll height and apply it on page load.

You can setup a JSON list or CSV list that can handle this data for you.

[{"page":"site(dot)com/page/387373x313123","last_scroll_pos":"200"},{"page":"site(dot)com/page/387373x37373","last_scroll_pos":"373"}]

EDIT:

Let me make a quick plugin for this. I’ll reply again shortly.

EDIT 2:

Here is the “Memorize Scroll” plugin. Enjoy. Just install it and it will automajically work. Plus a bonus: No WU’s.


Please let me know how this works out for you, and if it does, if you have time please leave a review! That’s the best way to show support.

2 Likes

Hi,

My use case is that I have a blog home page, where users can search for blogs and can click on view more to view all the blogs (3 new blogs are loaded on each click, I am storing this value in a custom state).
When they click on any one blog they are redirect to the a different page, when they click on back button on this new page. I want them to be redirected to the position they were in the blog home page. I want to retain the string they searched for as well.

I do not want to use cookies or localstorage as I do not want these values to be persisted. Is there a way to pass these values to URL params?

We can when we have a condition on the go to page action

1 Like

thanks, this solves it

This topic was automatically closed after 70 days. New replies are no longer allowed.