Record objects
New in version 13.2
Record objects have been introduced as an experimental feature.
Record objects are instances of \TYPO3\
.
They are an advanced data object holding the data of a database row, taking the TCA definition and possible relations of that database row into account.
Note
The Record object is available but still considered experimental. Only the usage in Fluid is public API.
Provide Records in TypoScript
In TypoScript you can use the RecordTransformationProcessor, usually in combination with the DatabaseQueryProcessor to pass record objects to the Fluid templating engine.
Provide records in PHP
Note
Creating record objects in PHP is considered experimental.
In PHP a record object can be created by the
\TYPO3\
.
Use records in Fluid
In frontend templates the record object is provided by TypoScript or passed to Fluid by a PHP class.
Content element preview templates automatically receive a record object representing the record of the content element that should currently be displayed.
The Debug ViewHelper <f:debug> output of the Record object is misleading for integrators, as most properties are accessed differently as one would assume.
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}
Using the raw record
The Record
object contains
only the properties, relevant for
the current record type, for example CType
.
In case you need to access properties, which are not defined for the record
type, the "raw" record can be used by accessing it via
{record.
. Those properties are not transformed.