Return to Prior Page

Is there a easy way to “return to prior page” without having to use the browser back arrow? If I am referencing an “information” page from different subdomains, I would like to have a button probably that allows the user to return to the prior page being viewed.

Morning @IdahoSAM

I moved this to the web development category since it isn’t directly Foundry related.

You might give this a look:

Big White Duck does Button Plus 2 stsck, which has a “back” option baked in.

1 Like

Thanks for your suggestion, but I couldn’t figure out where to put the two different codes that w3schools describes into RapidWeaver. Must be “going above my pay grade” :slight_smile:

@TemplateRepo Pretty complicated button to use. Tied to a lot of Foundation requirements it appears.

Button Plus 2 is not tied to Foundation, nor does it require Foundation. However if you’re using Foundation or Font Vault by JW, some settings for those uses are integrated, but not at all required if you’re not using them.

Have you tried taking a look at the videos and tutorials on the BWD site?

It’s far easier than you might think. Add the javascript to your Custom Javascript field on your page.

function goBack() {
  window.history.back();
}

Like so:

Then add the button code on your page where you want it. A handy way to do this is the HTML stack.

<button onclick="goBack()">Go Back</button>

The Button stack doesn’t have support for the onclick attribute, but future Button stacks will likely have this.

Add a couple of classes to that code snippet though and you might have something:

<button onclick="goBack()" class="btn btn-secondary">Go Back</button>

This should work fine. It won’t do anything in Preview Mode. Only on the published site.

All that said – this is custom code, so you’re on your own with it. But like I said, a future Foundry version will allow Buttons access to the onclick attribute.

2 Likes

Hi, it really isn’t. It’s most likely just a bit daunting with all the setting options, but you can ignore most.

Just add a Button Plus Defaults stack to the page, then add a Button Plus button wherever you want it. Select the “go back” as the type. You cna then style the button in the button settings by selecting “custom”, or using the Button Plus defaults stack.

It’s really simple.

Here is a quick demo. Transfer - Dropbox

And as said, it’s not tied to Foundation or any theme/framework. It just has some Foundation defaults built in, should you have been using the original Foundations framework.

2 Likes