Data source resolution
This page describes in detail how data sources are resolved. It complements the introduction in Data sources and is relevant when combining nested processors or implementing a DataSourceAwareProcessor.
Availability
Not every data source is available in every context, and not every source necessarily holds what its name suggests:
- A processor invoked through TYPO3's
datachain always receives aProcessing content. Once it is nested inside another processor's ownObject Configuration data, that value is no longer the top-levelProcessing HANDLEBARSTEMPLATEconfiguration — it is whatever the parent processor forwards instead (e.g.current).Value - The collection built for
HANDLEBARSTEMPLATE's ownpre/Processing posthooks sets onlyProcessing contentandObject Renderer processor;Configuration contentandObject Configuration processedare absent there.Data
Priority order
When a lookup is not restricted to a specific source, all sources that are actually available are searched in priority order, highest first:
processorConfiguration processedData contentObject Renderer contentObject Configuration
The first source that has the requested key wins; sources are never merged
for this kind of lookup. This is why an option like
table
, set
by an outer processor, can be picked up by a nested processor without being
repeated explicitly — as long as the nested processor actually queries that
source (some processors restrict a given option to a specific source, or a
specific subset, rather than searching all four).
Nested keys
A lookup key may use
/
to reach into a nested array within a
single data source, e.g.
some/. Each segment is
looked up literally, one level at a time; the lookup fails (and any
configured default value is used) as soon as one segment does not exist.
A key is otherwise always matched literally, dots and all. This matters for
raw TypoScript arrays, which store sub-properties of a key under that same
key with a literal trailing dot appended (e.g.
data
for the contents of a
data block) — such a
key is looked up as-is and is not itself treated as a path.
Payload resolution
The
data option (or a processor-specific option name such
as
iterable
) is resolved as follows:
- A single reference is resolved and used as-is, whatever its type — it is not coerced into an array.
- Multiple references, configured as a TypoScript array with numeric keys, are resolved in ascending key order. If every reference resolves to an array, they are merged, with later references overriding earlier ones on key conflicts. If any reference does not resolve to an array, the last resolved reference wins outright — all earlier references, including any that were arrays, are discarded rather than partially merged.
current = 1bypasses the resolution entirely and uses the content object's current value (Content).Object Renderer:: get Current Val ()
A warning is logged, and the payload cannot be resolved, if the option is
empty, references an unsupported data source identifier, a data source that
is missing in the current context, or a sub-path that does not exist within
a data source. An unconfigured option is not an error, though — in this case,
the inline
data
fallback applies.
The
data
fallback always uses the fixed key
data
(
data.
for an inline array in
processor,
or a plain
data
key already present in
processed),
regardless of what the primary option is called for a given processor. See
each processor's documentation for further, processor-specific fallbacks.
In PHP, the same resolution is available via
Data, see
Resolving a data payload via a configurable keyword.