Back button from dynamic page to previous page

Hello,

I am trying to create a back button to navigate from a dynamic page e.g. staff profile back to the previous page, same as the back button in the browser. Is this possible with code?

Thank you.

Yes.

Consider two scenarios: person landed on the dynamic page via a direct external source (like Google, saved bookmark, shared URL, etc), or person landed on the dynamic page from a repeater/gallery/other internal source on your website.

You would create a variable that gets generated each time the person starts at this “internal source”. Think of it like a cookie code on a page they came from.

So when they go to the dynamic page you can check if this cookie exists, if it does, show the back button, and on button click navigate to the URL you retrieved from this cookie.

If the cookie does not exist, that means they came from an external source. So you can either keep the back button hidden OR set the default URL to be whatever page you want them to go.