Disable redirect on new subscribe


#1

Version ghost:1.22.4

I’m using the awesome new subscribe feature but there’s one thing we’d really like to avoid: redirecting the user to the /subscribe page upon subscribe. We want them to stay on the same page they subscribed on. Is there any way to do this?


#2

@etanb maybe you can just perform the POST to /subscribe through AJAX.


#3

Have you seen this work before? Don’t I need to know what input fields I need to be sending in my POST request?


#4

@etanb yes I’ve it on my blogs.

The way it works in your theme is just adding a customizable line in your template:

{{subscribe_form
    form_class="gh-signin"
    input_class="gh-input"
    button_class="gh-btn gh-btn-blue gh-btn-block"
    placeholder="Your email address"
    autofocus="true"
}}

So I bet you can add some JS code to event.preventDefault(); and perform your own “AJAX” call parsing all the elements inside the form.


#5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.