We had a recent question about how to do this, so we've turn this into a mini tutorial...
So first of all i have a snippet with an button where i can call
this popup modal. Here we send the variable action=view to the
popup_example snippet when the button is pressed.
Then in the snippet called 'popup_example' we use that variable to
let the popup snippet know when to show the popup and when to go back to
the last screen.
So, going through whats going on here in steps for this snippet...
1 Comment
Customer Support
said
about 7 years ago
we sent action=view from the previous screen, so we can check this in a switch-case to see if we should view or exit the popup.
If there is other data you want to send with the form you can do that in the view method.
In html we use handlebars to check if 'exit' was sent in the form,
and if not we draw a simple title with some text and a button.
the button triggers the same snippet, only this time we pass in the
action=exit, and the target is our original placeholder screen.
now the snippet runs again, only instead of view, we'll run the exit method which adds the exit variable to the form.
Now when we run the html we close the modal and bring up the last screen again.
Customer Support
We had a recent question about how to do this, so we've turn this into a mini tutorial...
So first of all i have a snippet with an button where i can call this popup modal. Here we send the variable action=view to the popup_example snippet when the button is pressed.
<gs-link snippet="popup_example?action=view" target="modal-small">
<button>Show Popup</button>
</gs-link>
Then in the snippet called 'popup_example' we use that variable to let the popup snippet know when to show the popup and when to go back to the last screen.
So, going through whats going on here in steps for this snippet...