Listed below are additional filters. See more filters here, however please keep in mind that not all Liquid filters work in Neon Fundraise's system.
Filters listed on this page:
- cal
- date
- default
- exists
- is_recurring_donation_recipient
- is_self_recurring_donor
- money
- name
cal
Applies to Campaign
object only. Returns a URL that provides the user with a calendar invite for the campaign that they can import in their calendar client. The filter populates the campaign name as the event title, the campaign date/time as the event date and start time with a default one hour duration, the campaign location as the event location, and the campaign description as the event description.
The filter can populate a URL for Google Calendar or any other calendar (like Apple, Outlook, etc). The desired service should be defined as a filter value, with either 'google' for Google Calendar, or 'ics' for any non-Google calendars, like so:
{{ Campaign | cal: 'google' }}
{{ Campaign | cal: 'ics' }}
To modify the duration, add the desired duration in minutes (be sure to separate filter parameters with a comma). In the following example, the event duration will be two hours:
{{ Campaign | cal: 'google', 120 }}
The ics filename defaults to the campaign name, but may also be modified in the filter parameters, by adding a string within quotes after the duration.
Below is a HTML/Liquid block you can use to add visual links to Google, Apple, and other calendar invites on your campaign website or in emails:
Add this event to your calendar:<br>
<a href="{{Campaign | cal: 'ics'}}" target="_blank"><img src="https://cdn3.rallybound.org/content/global/img/add-calendar-apple.png" alt="Add to Apple Calendar"></a> <a href="{{Campaign | cal: 'google'}}" target="_blank"><img src="https://cdn3.rallybound.org/content/global/img/add-calendar-google.png" alt="Add to Google Calendar"></a> <a href="{{Campaign | cal: 'ics'}}" target="_blank"><img src="https://cdn3.rallybound.org/content/global/img/add-calendar-any.png" alt="Add to any calendar"></a>
Add this event to your calendar:
date
Converts a timestamp into another date format.
{{ Campaign.Event_Date | date: "%B %d, %Y" }}
January 1, 2020
date
accepts the same parameters as Ruby's strftime
method. You can find a list of the shorthand formats in Ruby's documentation or use a site like strfti.me.
default
Sets a default value for any variable with no assigned value. Can be used with strings, arrays, and hashes.
The default value is returned if the variable resolves to nil
, false
or an empty string ""
. A string containing whitespace characters will not resolve to the default value.
Dear {{ Donor.First_Name | default: "donor" }}
,
If the donor has no first name, the output will be:
Dear donor,
exists
Checks to see if the object or attribute exists. Does not work on all objects. Use this filter in an if tag to add content that should appear if the object or attribute exists:
{% if Team | exists %}
Invite team members for a successful campaign!{% else %}
Thank you for your support.{% endif %}
If the user is on a team, the output will be:
Invite team members for a successful campaign!
If the user is not on a team, the output will be:
Thank you for your support.
is_recurring_donation_recipient
Checks to see if a fundraiser has received a recurring donation. Only works on the User object. Is best used to award badges to fundraisers who have received recurring donations.
is_self_recurring_donor
Checks to see if a fundraiser has made a recurring donation to their goal. Only works on the User object. Is best used to award badges to fundraisers who have made recurring donations to their goals.
money
Returns a number in monetary format.
{{ Donation.Amount | money }}
$54
The number of decimal places can be defined by appending a number to the filter. For example:
{{ Donation.Amount | money, 2 }}
$54.00
name
Returns the user's full name (first and last). If there is no name listed, it will return the company name. Only works for fundraisers, not donor-only or org-level users.
{{ User | name }}
John Doe