-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related: https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.3/Feature-78450-IntroducePreviewRendererPattern.html Resolves: #781 Releases: main, 12.4, 11.5
- Loading branch information
1 parent
f2bca76
commit 120b979
Showing
2 changed files
with
104 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,52 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _ctrl-reference: | ||
.. include:: /Includes.rst.txt | ||
.. _ctrl-reference: | ||
|
||
========== | ||
Properties | ||
========== | ||
|
||
.. toctree:: | ||
.. toctree:: | ||
|
||
AdminOnly | ||
Container | ||
CopyAfterDuplFields | ||
Crdate | ||
DefaultSortby | ||
Delete | ||
DescriptionColumn | ||
Editlock | ||
Enablecolumns | ||
Ext | ||
FormattedLabelUserFunc | ||
FormattedLabelUserFuncOptions | ||
GroupName | ||
HideAtCopy | ||
HideTable | ||
Iconfile | ||
IsStatic | ||
Label | ||
LabelAlt | ||
LabelAltForce | ||
LabelUserfunc | ||
LanguageField | ||
OrigUid | ||
PrependAtCopy | ||
ReadOnly | ||
RootLevel | ||
SearchFields | ||
Security | ||
SeliconField | ||
ShadowColumnsForNewPlaceholders | ||
Sortby | ||
Title | ||
TranslationSource | ||
TransOrigDiffSourceField | ||
TransOrigPointerField | ||
Tstamp | ||
Type | ||
TypeiconClasses | ||
TypeiconColumn | ||
UseColumnsForDefaultValues | ||
VersioningWS | ||
VersioningWSAlwaysAllowLiveEdit | ||
AdminOnly | ||
Container | ||
CopyAfterDuplFields | ||
Crdate | ||
DefaultSortby | ||
Delete | ||
DescriptionColumn | ||
Editlock | ||
Enablecolumns | ||
Ext | ||
FormattedLabelUserFunc | ||
FormattedLabelUserFuncOptions | ||
GroupName | ||
HideAtCopy | ||
HideTable | ||
Iconfile | ||
IsStatic | ||
Label | ||
LabelAlt | ||
LabelAltForce | ||
LabelUserfunc | ||
LanguageField | ||
OrigUid | ||
PrependAtCopy | ||
PreviewRenderer | ||
ReadOnly | ||
RootLevel | ||
SearchFields | ||
Security | ||
SeliconField | ||
ShadowColumnsForNewPlaceholders | ||
Sortby | ||
Title | ||
TranslationSource | ||
TransOrigDiffSourceField | ||
TransOrigPointerField | ||
Tstamp | ||
Type | ||
TypeiconClasses | ||
TypeiconColumn | ||
UseColumnsForDefaultValues | ||
VersioningWS | ||
VersioningWSAlwaysAllowLiveEdit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
.. include:: /Includes.rst.txt | ||
.. _ctrl-reference-previewrenderer: | ||
|
||
=============== | ||
previewRenderer | ||
=============== | ||
|
||
.. confval:: previewRenderer | ||
|
||
:Path: $GLOBALS['TCA'][$table]['ctrl'] | ||
:type: string | ||
:Scope: Display | ||
|
||
Configure a backend preview for a content element. | ||
|
||
Examples | ||
======== | ||
|
||
Have also a look at :ref:`t3coreapi:ConfigureCE-Preview` for more details. | ||
|
||
Use for any record in a table | ||
----------------------------- | ||
|
||
This specifies the preview renderer to be used for any record in :sql:`my_table`: | ||
|
||
.. code-block:: php | ||
$GLOBALS['TCA']['my_table']['ctrl']['previewRenderer'] | ||
= \MyVendor\MyExtension\Preview\PreviewRenderer::class; | ||
Table has a "type" field/attribute | ||
---------------------------------- | ||
|
||
This specifies the preview renderer only for records of type :php:`$type` as | ||
determined by the type field of your table. | ||
|
||
.. code-block:: php | ||
$GLOBALS['TCA']['my_table']['types'][$type]['previewRenderer'] | ||
= \MyVendor\MyExtension\Preview\PreviewRenderer::class; | ||
Table has a "subtype_value_field" setting | ||
----------------------------------------- | ||
|
||
If your table and field have a :php:`subtype_value_field` TCA setting (like | ||
:sql:`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): | ||
|
||
.. code-block:: php | ||
$GLOBALS['TCA'][$table]['types'][$type]['previewRenderer'][$subType] | ||
= \MyVendor\MyExtension\Preview\PreviewRenderer::class; | ||
Where :php:`$type` is for example :php:`list` (indicating a plugin) and | ||
:php:`$subType` is the value of the :php:`list_type` field when the | ||
type of plugin you want to target is selected as plugin type. |