Adding Donor Logins to Your Theme

No comments

The following article is intended for theme developers only. If you’re not familiar with HTML, CSS, and JavaScript, it might just look like gobbledygook.

To enable the donor registration and login feature in GiftFold, follow these 3 steps:

1. Add a Sign-In Form to Your Theme’s Layout

We suggest you place a simple, inline form in the upper, right hand section of your layout. Users will expect to find it there, while visitors won’t feel like they have to login. To make it less obtrusive, you might consider hiding the form behind a “Login” link using JavaScript.

Here’s some code you can copy and paste into your theme to add a sign-in form (and sign out option if the visitor is already signed in):

{% if donor %}
<div>Signed in as {{ }}. <a href="{% signout_url %}">Sign Out</a></div>
{% else %}
{% signin_form %}
<label for="session_email">E-mail Address</label>
<input id="session_email" name="auth_key" placeholder="E-mail address" type="text" />
<label for="session_password">Your Password</label>
<input id="session_password" name="password" placeholder="Your password" type="password" />
<button type="submit">Sign In</button>
{% endsignin_form %}
{% endif %}

2. Add a Password and Password Confirmation Field to Your Form

Once your donors know they can sign-in, they will want to know how to register. Fortunately, we’ve made this process extremely simple for the donor. All they will need to do is add a password to their donation.

To add Donor Registration to your GiftFold theme, simply add these two inputs to your form template (templates/form.liquid):

<input name="donation[password]" type="password" value="{{ donation.password }}" />


<input name="donation[password_confirmation]" type="password" value="{{ donation.password_confirmation }}" />

If you want to go a step further, hide these inputs behind a “Click here to create an account” checkbox with some JavaScript.

3. Tell Your Donors

Once you’ve implemented the registration and login feature, you might want to tell your donors about it. We suggest you email them and let them know. It will give you another reason to talk them, and it might encourage them to come back and make another donation.

And that’s all! Pretty simple, right?

JonAdding Donor Logins to Your Theme

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *