Feature: GetCurrentContentRecordMethodTrait for plugins
Description
The new trait
FGTCLB\ provides
get for Extbase action controllers. It builds the record
of the current content element from the tt_ row of the content object
renderer, so it can be assigned as record view variable next to the usual
data array:
$this->view->assignMultiple([
'data' => $this->getCurrentContentObjectRenderer()?->data,
'record' => $this->getCurrentContentRecord($this->getCurrentContentObjectRenderer()),
]);
TYPO3 v14 renders the header of the shared EXT: header
partial with {record -> f:, which requires a record object.
Content elements based on lib. get it from the
record- data processor, Extbase plugin views do not. Without the
variable, plugin templates that render that partial abort on TYPO3 v14.
TYPO3\ behaves identically in TYPO3 v13 and
v14, therefore the trait needs no core version aware handling. TYPO3 v13 ignores
the variable, because its header partial reads data.
Impact
Extensions building on EXT: can use the trait to make their
plugins render on TYPO3 v14 and to give their templates access to a record
object.