@@ -17,6 +17,8 @@ class is responsible for generating the preview and the wrapping.
1717The default preview renderer is :php: `\T YPO3\C MS\B ackend\P review\S tandardContentPreviewRenderer `
1818and handles the Core's built-in content types (field :sql: `CType ` in table :sql: `tt_content `).
1919
20+ .. _ContentPreviewRenderer :
21+
2022Extend the default preview renderer
2123===================================
2224
@@ -25,31 +27,43 @@ via page :ref:`TSconfig <ConfigureCE-Preview-PageTSconfig>` or :ref:`event liste
2527
2628.. _ConfigureCE-Preview-PageTSconfig :
2729
28- Page TSconfig
29- -------------
30+ Preview rendering with a Fluid template and page TSconfig
31+ ---------------------------------------------------------
32+
33+ .. versionchanged :: 14.0
34+ A :php: `\T YPO3\C MS\C ore\D omain\R ecordInterface ` is passed as variable
35+ `{record} ` to the Fluid Template. The fields are not passed as direct
36+ variables anymore. `{pi_flexform_transformed} ` has been replaced by
37+ `{record.pi_flexform} `. See also `Breaking: #92434 - Use Record API
38+ in Page Module Preview Rendering <https://docs.typo3.org/permalink/changelog:breaking-92434-1761644184> `_.
39+
3040
3141This is the "integrator" way, no PHP coding is required. Just some page TSconfig
3242and a Fluid template.
3343
34- .. code-block :: typoscript
44+ .. literalinclude :: _codesnippets/_preview. typoscript
3545 :caption: EXT:my_extension/Configuration/page.tsconfig
3646
37- mod.web_layout {
38- tt_content {
39- preview {
40- # Your CType
41- example_ctype = EXT:my_extension/Resources/Private/Templates/Preview/ExampleCType.html
42- }
43- }
44- }
47+ For more details see the :ref: `TSconfig Reference <t3tsref:pageweblayoutpreview >`.
4548
4649In the Fluid template, the following variables are available:
4750
48- * All properties of the :php: `tt_content ` row (for example `{uid} `, `{title} `, and `{header} `)
49- * The current record as object (:php: `\T YPO3\C MS\C ore\D omain\R ecord `) in `{record} `
50- * FlexForm settings as array in `{pi_flexform_transformed} `
51+ * The current record as object (:php-short: `\T YPO3\C MS\C ore\D omain\R ecord `)
52+ in variable `{record} `
5153
52- For more details see the :ref: `TSconfig Reference <t3tsref:pageweblayoutpreview >`.
54+ .. literalinclude :: _codesnippets/_Preview.html
55+ :caption: EXT:my_extension/Resources/Private/Templates/Preview/MyCType.html
56+
57+ .. rubric :: Migration
58+
59+ .. code-block :: diff
60+
61+ -<h2>{header}</h2>
62+ +<h2>{record.header}</h2>
63+ -<p>{bodytext}</p>
64+ +<p>{record.bodytext}</p>
65+ -<small>{pi_flexform_transformed.settings.welcome_header}</small>
66+ +<small>{record.pi_flexform.sheets.s_messages.settings.welcome_header}</small>
5367
5468 .. _ConfigureCE-Preview-EventListener :
5569
@@ -67,9 +81,16 @@ Have a look at this :ref:`showcase implementation <PageContentPreviewRenderingEv
6781
6882For general information see the chapter on :ref: `implementing an event listener <EventDispatcherImplementation >`.
6983
84+ .. _ConfigureCE-Preview-preview-renderer :
85+
7086Writing a preview renderer
7187==========================
7288
89+ .. versionchanged :: 14.0
90+ The `@internal ` class
91+ :php-short: `\T YPO3\C MS\B ackend\V iew\B ackendLayout\G rid\G ridColumnItem ` has been
92+ updated to work with Record objects.
93+
7394A custom preview renderer must implement the interface
7495:php: `\T YPO3\C MS\B ackend\P review\P reviewRendererInterface ` which contains
7596the following API methods:
0 commit comments