Modifiers

Modifiers manipulate the data of your variables on the fly in Antlers templates. They can modify strings, filter arrays and lists, perform comparisons, handle basic math, simplify your markup, and even help you debug.

Overview

Modifiers are available exclusively in Antlers templates. Each modifier is a function that accepts the value of the variable it’s attached to, can do just about anything with that data, and then returns it. Multiple modifiers chained onto a variable will be executed in sequence, each passing its modified value onto the next.

Related Reading

Eager for more knowledge? Check out Antler’s modifier syntax and discover how to build your own.

Core Modifiers

add
ampersand_list
as
ascii
at
background_position
backspace
camelize
cdata
ceil
collapse
collapse_whitespace
console_log
contains
contains_all
contains_any
count
count_substring
dashify
days_ago
decode
deslugify
divide
dl
dump
embed_url
ends_with
ensure_left
ensure_right
entities
explode
favicon
first
flatten
flip
floor
format
format_localized
format_number
full_urls
get
gravatar
group_by
has_lower_case
has_upper_case
hours_ago
image
in_array
insert
is_after
is_alpha
is_alphanumeric
is_before
is_between
is_blank
is_email
is_embeddable
is_empty
is_future
is_json
is_leap_year
is_lowercase
is_numberwang
is_numeric
is_past
is_today
is_uppercase
is_url
is_weekday
is_weekend
is_yesterday
join
last
lcfirst
length
limit
link
list
lower
macro
mailto
markdown
merge
minutes_ago
mod
modify_date
months_ago
multiply
nl2br
obfuscate
obfuscate_email
offset
ol
option_list
output
pad
partial
piped
plural
rawurlencode
read_time
regex_replace
relative
remove_left
remove_right
repeat
replace
reverse
round
safe_truncate
sanitize
seconds_ago
segment
sentence_list
shuffle
singular
slugify
smartypants
sort
spaceless
starts_with
strip_tags
substr
subtract
sum
surround
swap_case
table
textile
tidy
timezone
title
to_json
to_spaces
to_tabs
trans
trim
truncate
ucfirst
ul
underscored
unique
upper
url
urldecode
urlencode
weeks_ago
where
widont
word_count
wrap
years_ago
yes_no
Betterify this page on Github!