%- # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -%>
<%= content_for :stylesheets do %>
<%= stylesheet_link_tag 'nonprofits/button/page' %>
<% end %>
<% content_for(:footer_hidden) {'hidden'} %>
<% content_for :javascripts do %>
<%= javascript_pack_tag 'i18n', 'page__nonprofits__button' %>
<% end %>
Donate Form Builder
<%= render 'tabs', active: :advanced %>
You can provide any image or text inside the above link.
Include the Donate Button SDK somewhere within the HTML of your page. Include this script only once on your site.
<%= render 'include_snippet' %>Place an empty link with 'commitchange-donate' as the class wherever you want the button to appear.
You can embed the donation form directly into your page by adding the "data-embedded" attribute.
If you want to provide some custom text or a custom image for the donate button, add the "data-custom" attribute.
To preset a custom designation for every donation made through the button, set the "data-designation" attribute.
You can also provide a description of your designation using the "data-designation-desc" attribute.
To provide a preset single amount for the button, use the "data-single-amount" attribute. Set its value to an amount in dollars.
For example, for a button that only takes $15 donations:
To provide custom multiple amounts, use the "data-custom-amounts" attribute. You must provide multiple amounts separated by commas. Set each amount to dollars.
You can set all donations through your button as either recurring or one-time by specifying the data-type attribute as either "one-time" or "recurring."
After the donation is completed, you can have the donor redirect to your own custom thank you page. Give a URL for the data-redirect attribute to get this functionality. Be sure to specify "http://" or "https://" in the url.
Use the ID of the campaign in the data-campaign-id attribute for the button (or the "campaign_id" URL parameter). You can find the campaign ID at the top of the campaign page, near the settings buttons, when you are signed in as an admin:
You can also set a gift option ID. The gift option ID can be found in the 'Manage Gift Options' popup on the associated campaign page
You can set the data-custom-fields attribute to add custom fields to the info step of the donate form. Each custom field attribute is comprised of two parts separated by an colon character (example: "shirt size: T-shirt size"). The first part is the name of the custom field and the second part is the text to display on the input. If the second part isn't provided, the name of the custom field will be displayed on the input. Each custom field should be separated by a comma. If the custom field doesn't already exist it will be created.