previewRenderer

previewRenderer
Type
string
Path
$GLOBALS['TCA'][$table]['ctrl']
Scope
Display

Configures a backend preview for a content element.

Examples

Have also a look at Configure custom backend preview for content element for more details.

Use for any record in a table

This specifies the preview renderer to be used for any record in tx_myextension_domain_model_mytable:

$GLOBALS['TCA']['tx_myextension_domain_model_mytable']['ctrl']['previewRenderer']
    = \MyVendor\MyExtension\Preview\PreviewRenderer::class;
Copied!

Table has a type field/attribute

This specifies the preview renderer only for records of type $type as determined by the type field of your table.

$GLOBALS['TCA']['tx_myextension_domain_model_mytable']['types'][$type]['previewRenderer']
    = \MyVendor\MyExtension\Preview\PreviewRenderer::class;
Copied!

Table has a subtype_value_field setting

If your table and field have a subtype_value_field TCA setting (like tt_content.list_type) and you want to register a preview renderer that applies only when that value is selected (for example, when a certain plugin type is selected and you can not match it with the type of the record alone):

$GLOBALS['TCA'][tx_myextension_domain_model_mytable]['types'][$type]['previewRenderer'][$subType]
    = \MyVendor\MyExtension\Preview\PreviewRenderer::class;
Copied!

Where $type is for example list (indicating a plugin) and $subType is the value of the list_type field when the type of plugin you want to target is selected as plugin type.