process-variables 

Class: \CPSIT\Typo3Handlebars\DataProcessing\ProcessVariablesProcessor

Processes a variables configuration block — exactly like the top-level variables of HANDLEBARSTEMPLATE — within a data processor chain. This is most useful when combined with other processors such as database-query , allowing per-record variable processing.

Data sources 

When resolving configuration values, the processor draws from four data sources, tried in the order listed:

Data source identifier Contains
contentObjectRenderer Current record's field values
contentObjectConfiguration Top-level HANDLEBARSTEMPLATE config
processedData Accumulated output from previous processors
processorConfiguration This processor's own config block

This is why options like table and as can be set by an outer processor and automatically picked up by a nested process-variables without being repeated explicitly. The preProcessing and postProcessing hooks receive the same collection, so they have access to all four sources as well.

Standalone usage 

tt_content.my_element = HANDLEBARSTEMPLATE
tt_content.my_element {
    templateName = MyElement

    dataProcessing {
        10 = process-variables
        10 {
            variables {
                header = TEXT
                header.field = header

                teaser = TEXT
                teaser.field = bodytext
                teaser.parseFunc < lib.parseFunc_RTE
            }
        }
    }
}
Copied!

Nested inside another processor 

dataProcessing {
    10 = database-query
    10 {
        table = tx_myext_domain_model_item
        as = items

        dataProcessing {
            10 = process-variables
            10 {
                table = tx_myext_domain_model_item
                as = item
                variables {
                    title = TEXT
                    title.field = title

                    body = TEXT
                    body.field = bodytext
                    body.parseFunc < lib.parseFunc_RTE
                }
            }
        }
    }
}
Copied!

Properties 

variables
Variables to process. Same syntax as the top-level variables in HANDLEBARSTEMPLATE .
table
Database table of the record to use as the data source for field lookups. Defaults to the current content element table.
as
Target key in the processed data array. When set, the processed variables are stored under this key. When omitted, the processed variables replace (or merge into) the root of the processed data.
merge
Boolean. When 1 and as is omitted, the processed variables are merged into the existing processed data rather than replacing it. When as is set and the key already holds an array, the processed variables are merged into that array. Default: 0 .
if
Standard TypoScript if condition. When the condition evaluates to false, the processor is skipped and the processed data is returned unchanged.
preProcessing
Data source aware processors run before variables are processed.
postProcessing
Data source aware processors run after variables are processed.