record-transformation
data processor
New in version 13.2
A new TypoScript data processor for FLUIDTEMPLATE and
PAGEVIEW
has been added.
The \TYPO3\
,
alias record-
, can typically be used in
conjunction with the DatabaseQuery Data Processor. The DatabaseQuery Data
Processor typically fetches records from the database, and the
record-
will take the result, and transforms
the objects into Record
objects, which contain only relevant data from
the TCA table, which has been configured in the TCA columns
fields for this
record.
This is especially useful for TCA tables, which contain "types" (such as pages
or tt_
database tables), where only relevant fields are added to the
record object. In addition, special fields from "enableColumns" or deleted
fields, next to language and version information are extracted so they can be
addressed in a unified way.
The type
property contains the database table name and the actual type based
on the record, such tt_
for Content Elements.
Example: Usage with the DatabaseQueryProcessor
Example usage for the Data Processor in conjunction with the database-query data processor.
Example: Usage with FLUIDTEMPLATE
Transform the current data array of FLUIDTEMPLATE to a record object. This can be used for Content Elements of Fluid Styled Content or custom ones. In this example the Fluid Styled Content element "Text" has its data transformed for easier and enhanced usage.
Usage in Fluid
The f:
output of the Record object is misleading for integrators,
as most properties are accessed differently as one would assume. The debug view
is most of all a better organized overview of all available information. E.g.
the property properties
lists all relevant fields for the current Content
Type.
We are dealing with an object here. You however can access your record
properties as you are used to with {record.
or
{record.
. In addition, you gain special, context-aware properties
like the language {record.
or workspace
{data.
.
Overview of all possibilities:
<!-- Any property, which is available in the Record (like normal) -->
{record.title}
{record.uid}
{record.pid}
<!-- Language related properties -->
{record.languageId}
{record.languageInfo.translationParent}
{record.languageInfo.translationSource}
<!-- The overlaid uid -->
{record.overlaidUid}
<!-- Types are a combination of the table name and the Content Type name. -->
<!-- Example for table "tt_content" and CType "textpic": -->
<!-- "tt_content" (this is basically the table name) -->
{record.mainType}
<!-- "textpic" (this is the CType) -->
{record.recordType}
<!-- "tt_content.textpic" (Combination of mainType and record type, separated by a dot) -->
{record.fullType}
<!-- System related properties -->
{data.systemProperties.isDeleted}
{data.systemProperties.isDisabled}
{data.systemProperties.isLockedForEditing}
{data.systemProperties.createdAt}
{data.systemProperties.lastUpdatedAt}
{data.systemProperties.publishAt}
{data.systemProperties.publishUntil}
{data.systemProperties.userGroupRestriction}
{data.systemProperties.sorting}
{data.systemProperties.description}
<!-- Computed properties depending on the request context -->
{data.computedProperties.versionedUid}
{data.computedProperties.localizedUid}
{data.computedProperties.requestedOverlayLanguageId}
{data.computedProperties.translationSource} <!-- Only for pages, contains the Page model -->
<!-- Workspace related properties -->
{data.versionInfo.workspaceId}
{data.versionInfo.liveId}
{data.versionInfo.state.name}
{data.versionInfo.state.value}
{data.versionInfo.stageId}
Table of contents
Options:
as
if
-
- Type
- if condition
- Default
- ''
Only if the condition is met the Data Processor is executed.
table
-
- Type
- string
- Default
- auto-resolved
The name of the database table of the records. Leave empty to auto-resolve the table from context.
If you are dealing with a custom data source you can adjust it here.
variableName
-
- Type
- string
- Default
- 'data'
The variable that contains the record(s) from a previous Data Processor, or from a FLUIDTEMPLATE view.
If you are dealing with a custom data source you can adjust it here.