Variable resolvers
Target group: Integrators, Developers
Table of Contents
Variables
You can use variables in the common process parameters, such as summary
or initiator
, and in the process table fields.
Variables look like: {__
or
{__
− in curly brackets with a double underscore
at the beginning.
Example:
finishers:
-
identifier: JobRouterStartInstance
options:
handle: 'start_website_contact'
summary: '{__LLL:EXT:your_ext/Resources/Private/Language/forms.xlf:demo.summary} ({__language.navigationTitle})'
initiator: '{__correlationId}'
processtable:
name: '{preName} {lastName}'
company: '{company}'
email_address: '{email}'
phone_number: '{phone}'
message: '{message}'
from_website: '{__language.base}'
Hint
You can build own variable resolvers. Have a look in the section Writing own variable resolvers.
Correlation ID
The correlation ID is generated from the form identifier and a unique key to identify associated transfers – as you can start multiple instances from one form and transmit data to a JobData table. The correlation ID is stored in a column in the transfer tables together with the form data. This is useful if you want to check the data from the instance against the original data from the form.
The correlation ID looks like this: form_
where form
indicates the ID is generated by a from finisher, demo-
is the form
identifier with the content element uid of the form plugin and 63fca23b1accb
is the unique key.
Use the {__
variable to add the correlation ID.
Note
The correlation ID is the same for every JobRouter form finisher in a form instance.
Tip
The correlation id can be used to set the initiator for a process instance start (if the initiator is not used to assign a step to a JobRouter® user). This way the correlation id is easy to spot in the step overview.
Localisation labels
Values can be localised with the help of the localisation labels known from
various parts in TYPO3. The variable starts with {__
and holds
the path to the translation file and the according key, for example,
{__
.
If the label is not found and therefore cannot be translated the value is untouched.
You can use multiple localisation labels in one form value.
Language information
Changed in version 4.0
{__
has been removed, use
{__
instead.
{__
has been removed without substitution.
The language information defined in the Site Configuration can be used, namely:
- {__language.base}
- The base URL for the language, for example,
https://
.example. org/ en/ - {__language.flagIdentifier}
- The defined TYPO3 flag identifier used in TYPO3's backend, for example,
flags-
.gb - {__language.hreflang}
- Language tag for the language defined by RFC 1766 / 3066 for
lang
hreflang
attributes, for example,en-
.gb - {__language.languageId}
- The language ID defined in the site configuration.
- {__language.locale}
- The used locale, for example,
en_
.GB. UTF- 8 - {__language.locale.countryCode}
New in version 4.0
The ISO-3166-1 alpha-2 country code, for example
US
.- {__language.locale.languageCode}
New in version 4.0
The ISO-639-1 language ISO code, for example,
en
.- {__language.navigationTitle}
- The navigation title defined in the site configuration, used as label
within language menus, for example,
English
. - {__language.title}
- The title defined in the site configuration, for example,
English
. - {__language.typo3Language}
default
for English, otherwise one of TYPO3's internal language keys.
Multiple language variables can be used in one form value.
JobRouter language information
Sometimes it is necessary to use not the language code of the page in your form
but instead the language string JobRouter® uses (for example, german
instead
of de
). This can be useful for sending localised emails from the process in
the relevant language.
Use the {__
variable for that. The following languages
are supported by JobRouter® in recent version:
ISO 639-1 code | JobRouter® language |
---|---|
ar | arabic |
cs | czech |
da | danish |
de | german |
en | english |
es | spanish |
fi | finnish |
fr | french |
hr | croatian |
hu | hungarian |
it | italian |
ja | japanese |
lt | lithuanian |
nl | dutch |
pl | polish |
pt | portuguese |
ro | romanian |
ru | russian |
sk | slovak |
sl | slovenian |
sr | serbian |
tr | turkish |
zh | chinese |
If the language is not available, an empty string is returned by the variable resolver.
Page properties
The properties of the page where the form is located can be retrieved. The
variable starts with __
. Any existing page property, such as uid or
title, can be used, for example: {__
.
If a page property is not present, the variable is used unchanged.