Professional Documents
Culture Documents
Built In References - Strings Built In References - Strings (cont) Built In References - Strings (cont)
boolean Converts string to boolean js_string Escapes the string for remove_end Same as remove_beginning,
(true, false) Javascript String Literals ing except fromt he ending
cap_first Capitalizes first word of string json_string Escapes the string for JSON rtf Rich Text Format
capitalize Capitalizes every word in string String Literals split Split a string at each substring
properly keep_after Returns all text after substring, (substring)
(substring, not including substring
chop_linebre Removes line-break from end of starts_with Same as ends_with, but for
flags="")
ak string string beginning
keep_before Returns all text before
contains Checks if string contains string Takes a multi-value variable and
(substring) substring (substring, substring, not including returns just the string parts
flags="") substring
date, time, Converts string to substring Depricated, use string[x..y]
datetime date/time/datetime based on last_index_of Returns the index of the last
trim Removes leading and trailing
*_format (substring) occurance of substring
whitespace
left_pad (x, Returns the string with
ends_with Checks if string ends with uncap_first The opposite of cap_first
(substring) substring seperator=" [seperator] prepended up to a
") maximum length upper_case Opposite of lower_case
ensure_ends Returns string with substring
length The number of characters in url URL Character escaping
_with appended if not already there
the string url_path Same as url but doesn't escape
(substring)
lower_case Returns string in all lower case slashes
ensure_start Same as ensure_ends_with, but
s_with prepended matches Regex Pattern checker word_list Returns a sequence of all words
(substring) in a string
number The string as a number
groups[x] Returns the returns the regex xhtml Same as html, but for xhtml
replace Returns all occurances of
group from the matches method escaping
(substring, substring with replace
if it exists xml Same as hxtml, but difference
replace)
html Returns the string with html code for '
right_pad (x, Same as left_pad, but
characters parsed to seperator=" appended instead
ampersand codes ") Built In References - Numbers
index_of Returns the index of the remove_begin Returns string with substring abs Absolute Value
(substring) requested substring in string ning removed from the beginning
c Num to String without formatting
j_string Escapes the string for Java (substring)
is_infinite True if number is floating point
String Literals
infinite
Built In References - Numbers (cont) Built In References - Booleans Built In References - Nodes (XML)
round, floor, Rounds to closest, lowest, and c Boolean to String for computer ancestors(n Returns a sequence of nodes
ceiling highest, respectively languages ame) ancestors. Starts with immediate
parent and ends with root.
string.format Num to String with optional string("s Boolean to String with
Should be filtered with name
formatting (format can be tring1", human-readable flags. Provided as
number, currency, percent, or "string2" "string1" for true and "string2" for children Returns a sequence of all child
computer) ) false nodes
Rarely Used Built-Ins Template Language Quick Reference (cont) Template Language Quick Reference (cont)
byte, Converts numbers to other types compress Removes all but one newline local Like assign, but creates local
double, of numbers character between lines variables within macros or
float, int, functions
escape x <pre> tag for freemarker code
long, short
as x? macro/neste Macro outputs a block of user-
eval Evaluate a string as an FTL [escape d/return defined code which wraps
expression type] nested (optionally, otherwise
has_content Returns true if variable exists flush Forces generated output to be just outputs the code). return
works as a break
and isn't empty, false otherwise written. 99% of the time is not
interpret Returns the value of a string neccessary noparse <pre> tag for ftl
interpreted as FTL code. Sort of ftl Tells programs that file is an ftl nt No trim. Disables whitespace
like a function file. Takes optional parameters stripping
is_...[type] Checks if variable is of type found on the docs page setting Modifies parse settings. View
[type]. See docs for full list function/re Similar to a macro, except returns name=value full list in the docs page
turn a specific value as denoted by
namespace Returns macro or function stop Per ftl docs: an emergency
namespace, if any return [reason] brake. Don't use in normal
global Makes a global variable. Variable situations. Returns reason if set
new Creates a variable of type class.
will be exposed as if at data-model
Usage is var = "FQDN"? switch/case/ A regular switch block
level
new(options) default/break‐
number_to_[ Converts a number to if/elseif/els Creates an if/elseif/else block t, lt, rt Trim, left trim, right trim. Ignores
e
date/time/da date/time/datetime, using the whitespace based on tag
tetime] number of seconds since epoch import Imports the library at location path position used
path as for use in the current ftl file visit/recurse/ Used for parsing trees, usually
Template Language Quick Reference hash fallback XML. See the ftl docs for full info
include Includes the file at location path
assign name=value [in Creates a variable
path for use in current document
namespacehash] called name
list foreach loop
attempt/recover try/catch
sequence
as item