Static
checkedStatic
disabledStatic
concatConcatenate a number of string terms into a single string. This is useful for passing arguments with variable names.
Rest
...values: string[]The values to concatenate
{{filePicker target=(concat "faces." i ".img") type="image"}}
Static
editorConstruct an editor element for rich text editing with TinyMCE or ProseMirror.
The content to display and edit.
Optional
options: { The named target data element
Include a button used to activate the editor later?
A specific CSS class to add to the editor container
Is the text editor area currently editable?
The editor engine to use, see TextEditor.create.
Whether to turn on collaborative editing features for ProseMirror.
{{editor world.description target="description" button=false engine="prosemirror" collaborate=false}}
Static
ifA ternary expression that allows inserting A or B depending on the value of C.
The test criteria
The string to output if true
The string to output if false
The ternary result
{{ifThen true "It is true" "It is false"}}
Static
localizeTranslate a provided string key by using the loaded dictionary of localization strings.
<label>{{localize "ACTOR.Create"}}</label> <!-- "Create Actor" -->
<label>{{localize "CHAT.InvalidCommand" command=foo}}</label> <!-- "foo is not a valid chat message command." -->
Static
numberA string formatting helper to display a number with a certain fixed number of decimals and an explicit sign.
A numeric value to format
Additional options which customize the resulting format
The number of decimal places to include in the resulting string
Whether to include an explicit "+" sign for positive numbers *
The formatted string to be included in a template
{{formatNumber 5.5}} <!-- 5.5 -->
{{formatNumber 5.5 decimals=2}} <!-- 5.50 -->
{{formatNumber 5.5 decimals=2 sign=true}} <!-- +5.50 -->
{{formatNumber null decimals=2 sign=false}} <!-- NaN -->
{{formatNumber undefined decimals=0 sign=true}} <!-- NaN -->
Static
numberStatic
radioA helper to create a set of radio checkbox input elements in a named set. The provided keys are the possible radio values while the provided values are human readable labels.
The radio checkbox field name
A mapping of radio checkbox values to human readable labels
Options which customize the radio boxes creation
Which key is currently checked?
Pass each label through string localization?
let groupName = "importantChoice";
let choices = {a: "Choice A", b: "Choice B"};
let chosen = "a";
<div class="form-group">
<label>Radio Group Label</label>
<div class="form-fields">
{{radioBoxes groupName choices checked=chosen localize=true}}
</div>
</div>
Static
rangeRender a pair of inputs for selecting a value in a range.
Helper options
The name of the field to create
The current range value
The minimum allowed value
The maximum allowed value
The allowed step size
{{rangePicker name="foo" value=bar min=0 max=10 step=1}}
Static
selectA helper to create a set of <option> elements in a <select> block based on a provided dictionary. The provided keys are the option values while the provided values are human-readable labels. This helper supports both single-select and multi-select input fields.
A mapping of radio checkbox values to human-readable labels
Options which configure how select options are generated by the helper
Generated HTML safe for rendering into a Handlebars template
let choices = {a: "Choice A", b: "Choice B"};
let value = "a";
The template HTML structure
<select name="importantChoice">
{{selectOptions choices selected=value localize=true}}
</select>
The resulting HTML
<select name="importantChoice">
<option value="a" selected>Choice A</option>
<option value="b">Choice B</option>
</select>
let choices = {"Choice A": "a", "Choice B": "b"};
let value = "a";
The template HTML structure
<select name="importantChoice">
{{selectOptions choices selected=value inverted=true}}
</select>
let choices = {foo: {key: "a", label: "Choice A"}, bar: {key: "b", label: "Choice B"}};
let value = "b";
The template HTML structure
<select name="importantChoice">
{{selectOptions choices selected=value nameAttr="key" labelAttr="label"}}
</select>
let choices = [{key: "a", label: "Choice A"}, {key: "b", label: "Choice B"}];
let value = "b";
The template HTML structure
<select name="importantChoice">
{{selectOptions choices selected=value nameAttr="key" labelAttr="label"}}
</select>
Static
formStatic
form
A collection of Handlebars template helpers which can be used within HTML templates.