String filters are used to manipulate outputs and variables of the string type. See more string filters here, however please keep in mind that not all Liquid filters work in Neon Fundraise's system.
Filters on this page:
-
adverb
-
append
- as_int
-
capitalize
-
downcase
- natural_language
-
prepend
- prepend_an_or_a
-
remove
-
replace
- split
- to_title_case
- upcase
adverb
Returns the adverb of a recurring interval. Works specifically on the Recurring Donation object. Filter map the interval—
- day to "daily
- week to "weekly"
- month to "monthly"
- quarter to "quarterly"
- year to "annually"
Your card will be charged {{ Recurring_Donation.Recurring_Period | adverb }}
.
Your card will be charged monthly.
append
Concatenates two strings and returns the concatenated value.
{{ "/my/fancy/url" | append: ".html" }}
/my/fancy/url.html
append
can also be used with variables:
{% assign filename = "/index.html" %}
{{ "website.com" | append: filename }}
website.com/index.html
as_int
Casts a string as an integer, which can then be used for mathematical equations. Only works if the string can be converted to an int.
capitalize
Makes the first character of a string capitalized.
{{ "my great title" | capitalize }}
My great title
downcase
Makes each character in a string lowercase. It has no effect on strings which are already all lowercase.
{{ "Parker Moore" | downcase }}
parker moore
natural_language
Prepends the word "Team" to team names that don't already have the word in their name. Works specifically on the Team.Name
object.
Team: {{ Team.Name }}
Join {{ Team.Name | natural_language }} today!
If team name is "Awesome Fundraisers", the output will be:
Team: Awesome Fundraisers
Join Team Awesome Fundraisers today!
If team name is "Team Awesome", the output will be:
Team: Team Awesome
Join Team Awesome today!
prepend
Adds the specified string to the beginning of another string.
{{ "apples, oranges, and bananas" | prepend: "Some fruit: " }}
Some fruit: apples, oranges, and bananas
prepend
can also be used with variables:
{% assign url = "example.com" %}
{{ "/index.html" | prepend: url }}
example.com/index.html
prepend_an_or_a
Adds "an" or "a" before the word as grammatically appropriate. Note: only works on a single item — it does not remove the "a" or "an" for a plural version.
I bought {{ fruit | prepend_an_or_a }}
If the value of fruit
is "apple", the output will be:
I bought an apple
If the value of fruit
is "banana", the output will be:
I bought a banana
remove
Removes every occurrence of the specified substring from a string.
{{ "I strained to see the train through the rain" | remove: "rain" }}
I sted to see the t through the
replace
Replaces every occurrence of the first argument in a string with the second argument.
{{ "Take my protein pills and put my helmet on" | replace: "my", "your" }}
Take your protein pills and put your helmet on
split
Divides a string into an array using the argument as a separator. split
is commonly used to convert comma-separated items from a string to an array.
{% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{% for member in beatles %}
{{ member }}
{% endfor %}
John Paul George Ringo
to_title_case
Makes the first letter of each word in a string uppercase. It has no effect on strings which are already title case.
{{ "parker moore" | to_title_case }}
Parker Moore
upcase
Makes each character in a string uppercase. It has no effect on strings which are already all uppercase.
{{ "Parker Moore" | upcase }}
PARKER MOORE