Back button with custom

Hi.

I have a multi-state page, where the page (eg; homepage) has the custom state “page” which is a number value. I am trying to find out how to make a back button take you back to the previous “page” custom state. The only idea is that I could create a data field in the User of “prev page” which would hold the user’s previous page and take them to it.

Thank you.

Hey,
You could create another custom state called “history” that saves a list of numbers. Everytime a user performs an action to take them to a new page, you add the current page to the history (history add page). When a user wants to go back you could find the last page they visited by using history:last item and then remove the last item after the action is completed.
Hopefully this helped :slight_smile:
Dylan

1 Like

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