Data sources
Data processors often need to work on data that was prepared earlier, for
example the files returned by TYPO3's
files
processor or an
object assigned by an Extbase controller. The data processors provided by this
extension can read such data from so-called data sources.
Available data sources
| Data source identifier | Contains |
|---|---|
processor | This processor's own config block |
processed | Output of previous processors and variables |
content | Current record's field values |
content |
HANDLEBARSTEMPLATE
configuration,
or the configuration forwarded by a parent
processor |
Referencing data
Processors such as process-each accept a
data option that tells them which data to work on. Some
processors use a more specific option name for the same purpose, e.g.
iterable
(iterable-to-array),
object
(object-access) or
file
(media).
A reference consists of the data source identifier, a colon and the key
within that data source. Nested keys are separated by
/
:
dataProcessing {
10 = files
10 {
references.fieldName = image
as = files
}
# All files
20 = process-each
20 {
dataSource = processedData:files
# ...
}
# The first file only
30 = media
30 {
file = processedData:files/0
as = image
}
}
Instead of referencing existing data, inline data can be configured with
the
data
option:
20 = process-each
20 {
data {
10 = foo
20 = bar
}
}
If a reference cannot be resolved, a warning is logged and the processor leaves the processed data unchanged.
See also
Data source resolution for the complete resolution rules, e.g. how multiple references are merged.
Using the current value
Processors that run nested inside process-each or
iterable-to-array receive the item currently being
processed as the content object's current value. Set
current = 1
as sub-property of the data source option to use it. This works for all
processors listed above, e.g.
data,
object. or
iterable.:
20 = process-each
20 {
dataSource = processedData:files
as = processedFiles
dataProcessing {
10 = object-access
10 {
object.current = 1
path = publicUrl
as = url
}
}
}
Alternatively, the item can be referenced as
content.