Community X.

Connect with other creators, share ideas, give feedback and get the latest product updates.

Oct 15

How to save a variable value when you leave a page and return to it.

I am using a repeater to list items. I have drop down filters for; year, make, model and style so people can narrow down the 1,000 item list to say 10 items by using the drop down filters.

These filters are stored in variables and the code is on the repeater page.

When I click on an item it takes me to a detail page where there is a picture and more description of the item.


Here is the problem:

When I return to the repeater page I still want to see only 10 items but I see all 1,000.

How do I make sure the filter variable values are still know when I return to the repeater page?

The return button on the detail page is just a link back to the repeater page.


I thought there would be a static option when defining a variable, but cannot find it.

I tried to define the variable on the site instead of the page but the page says they are undefined.

I could maybe store them in a data set. Is there any way to save a variable when you leave and then return to that page?


Thanks for any suggestions,

Ray

2

Hi,


Great question! You can definitely store values per session, but you will need to use Corvid to get it done.


Here are a few type of storage you can use:


  • Local: Data in local storage never expires, even if the site visitor closes your page. When the visitor reopens the page later, the data can still be retrieved. You can store up to 50kb of data in local storage.

  • Session: Data in session storage is available while the site visitor's web session is active. The session ends when the visitor closes the browser tab or window. When the session ends, all the data in session storage is lost. Reloading or restoring the page does not affect session storage data. You can store up to 50kb of data in session storage.

  • Memory: Data in memory storage is available as long the site visitor does not refresh or close the page. Reloading or restoring the page clears the memory storage data. You can store up to 1mb of data in memory storage.


You can check out some documentation on storing data here: https://www.wix.com/corvid/reference/wix-storage

Editor X

Design your boldest creations.