Example: Back Button

#wix-location #wix-storage #session

Demonstrates how to use session storage to know which site page the visitor previously visited. The code needs to be placed in the Site tab so that it runs on all of the site’s pages. The code retrieves the URL of the page a visitor previously visited from session storage. It then stores the URL of the visitor’s current page in session storage. When the visitor navigates to another page, this stored URL is retrieved as the previous page URL.

Go to the Back Button page.

See more examples at Gramp’s Workbench .

4 Likes

Sorry @yisrael-wix but where can I find the “Site tab”?

First you need to enable Corvid:


Then the Site tab:

@yisrael-wix Thank you! I have never pay attention to that!

Is there anyway to return the user to the place where they scrolled to on the previous page? When a customer scrolls to the bottom of my store page and selects a product to view, when they click the back button it takes them to the top of the store page.

Here is my site with your back button implemented. https://www.utahfurnituredeals.com/benches-ottomans

I took a look at your site. You have the code in the Site code panel, but you don’t have a back button. The code has errors flagged since the Back Button is missing.

@yisrael-wix I only have the back button on the product page. https://www.utahfurnituredeals.com/product-page/finn-storage-bench

@groversarahellen Corvid does not currently support this functionality. Feel free to post a Feature Request .

Many thanks as ever. How can I extend this so the back button returns users to a stored / persistent search result on the previous page?

Many thanks