Filters

Filters transform template variables before they are rendered.

Binaries
first last length to_binary
Booleans
yesno
Dates
add_hour add_day add_month add_week add_year date date_range datediff eq_day in_future in_past ne_day sub_hour sub_day sub_month sub_week sub_year timesince…
Encryption
md5 sha1
Character escaping
brlinebreaks escape escape_check escape_ical escape_link escapejs escapejson escapexml fix_ampersands force_escape linebreaksbr slugify unescape urlencode…
Forms
pickle
HTML
show_media striptags truncate_html sanitize_html sanitize_url urlize embedded_media without_embedded_media render merge_tags
Lists
after before chunk exclude filter first flatten_value group_by index_of is_list join last length make_list member nthtail random randomize range reversed slice…
Mailing list
inject_recipientdetails mailinglist_recipient_key_decode
Menu
menu_flat menu_ids menu_is_visible menu_expand menu_rsc menu_subtree menu_trail
Miscellaneous
gravatar_code ip2country ip2geo is_letsencrypt_valid_hostname format_dispatch_controller_option format_dispatch_path_element
Numbers
filesizeformat format_duration format_integer format_number format_price is_even is_number max min minmax rand round round_significant to_integer…
Regular Expressions
match replace
Resource lists
group_firstchar group_title_firstchar is_a is_not_a is_visible media_for_language
Resources
admin_merge_diff content_type_label content_type_urls summary temporary_rsc
Strings
append capfirst center filesizeformat format_duration format_integer format_number format_price insert is_valid_email length ljust log_format_stack lower…
Survey
survey_answer_split survey_any_correct_answer survey_any_wrong_answer survey_as_pages survey_is_stop survey_is_submit survey_is_pagebreak_submit…
Translation
is_rtl language language_dir language_sort language_sort_localized media_for_language set_url_language trans_languages trans_filter_filled translation…
Tuples
element
URLs and links
is_site_url url url_abs sanitize_url is_letsencrypt_valid_hostname urlize escape_link urlencode urldecode parse_url
Variables
as_atom default if if_undefined is_defined is_undefined make_value pprint to_binary to_integer to_json from_json

Controllers Reference Tags

All Filters

ne_day

See also

normalize_email

Normalize an email address, used in the identity management.

nthtail

See also

parse_url

Parses an URL (URI) using uri_string:parse/1 .

pickle

Pickle an Erlang value so that it can be safely submitted with a form.

pprint

See also

rand

See also

random

See also

randomize

See also

range

Generate a list of integers, with an optional step.

render

Render a template.

replace

Regular expression replacement of a pattern with a string.

replace_args

Replace $N placeholders in string from a list of replacement values.

reversed

Reverse a list.

rjust

See also

round

Round a floating point value to the nearest integer.

round_significant

Round a number value to a number of significant digits. The significance defaults to two digits.

sanitize_html

Sanitize a HTML code. Removes elements and attributes that might be dangerous, like <script\> elements.

sanitize_url

Sanitize an URL. Removes URLs that might be dangerous, like javascript: URLs.

set_url_language

Change the language of an URL to another language. Useful to generate alternative URLs for a page.

sha1

Translate a string to a sha1 hex value.

show_media

See also

slice

Perform array-slice operations on a list or string.

slugify

See also

sort

The sort filter takes a list of items to sort. Items can be an ordinary list of terms, property lists, or maps. It can…

split

See also

split_in

See also

stringify

See also

striptags

Removes all HTML tags from the value.

sub_day

See also

sub_hour

See also

sub_month

See also

sub_week

See also

sub_year

See also

summary

Extract a summary from a resource.

survey_any_correct_answer

Determine if any answer of a question was correct. Used for showing results of thurstone test questions.

survey_any_wrong_answer

Determine if any answer of a question was wrong. Used for showing results of thurstone test questions.

survey_as_pages

Split the page blocks into pages, prepare them for easy display in the survey question editor.

survey_is_pagebreak_submit

Check if a list of questions contains a pagebreak block with an unconditional submit.

survey_is_stop

Check if there is a ‘stop’ question in list of (survey) blocks

survey_test_max_points

Counts the total of all points that can be received for all test questions. Non test questions are not counted.

tail

See also

temporary_rsc

Creates a temporary resource if its input value is not defined.

timesince

See also

to_binary

See also

toc

Filter to derive a Table Of Contents from a HTML body.

to_integer

See also

to_json

Display any value as in JSON (JavaScript Object Notation).

tokens

Returns a list of tokens from input string, separated by the characters in the filter argument.

to_name

Map a string to a name . That is a lowercased string with only [a-z0-9_] characters.

trans_filter_filled

Filters all empty translations from a property.

trans_languages

Return a list of all languages present in the given translated text ( #trans{} record).

translate

See also

translation

See also

trim

Removes whitespace at the start and end of a string.

truncate

See also

unescape

See also

upper

See also

url

See also

url_abs

See also

urldecode

See also

urlencode

See also

urlize

See also

utc

See also

vsplit_in

See also

without

Remove the items given in the argument from the filter value.

yesno

Show a boolean value as a text.