File tree Expand file tree Collapse file tree 4 files changed +16
-9
lines changed
Resources/Private/Templates Expand file tree Collapse file tree 4 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ class ContainerConfiguration
4242 */
4343 protected $ icon = 'EXT:container/Resources/Public/Icons/Extension.svg ' ;
4444
45- protected ? string $ backendTemplate = null ;
45+ protected string $ backendTemplate = ' EXT:container/Resources/Private/Templates/Container.html ' ;
4646
4747 /**
4848 * @var string
@@ -228,7 +228,7 @@ public function getIcon(): string
228228 return $ this ->icon ;
229229 }
230230
231- public function getBackendTemplate (): ? string
231+ public function getBackendTemplate (): string
232232 {
233233 return $ this ->backendTemplate ;
234234 }
Original file line number Diff line number Diff line change @@ -64,9 +64,6 @@ public function configureContainer(ContainerConfiguration $containerConfiguratio
6464 $ containerConfiguration ->getGroup (),
6565 ]
6666 );
67- }
68-
69- if ($ containerConfiguration ->getBackendTemplate () === null || (GeneralUtility::makeInstance (Typo3Version::class))->getMajorVersion () === 11 ) {
7067 $ GLOBALS ['TCA ' ]['tt_content ' ]['types ' ][$ containerConfiguration ->getCType ()]['previewRenderer ' ] = \B13 \Container \Backend \Preview \ContainerPreviewRenderer::class;
7168 }
7269
@@ -268,12 +265,10 @@ public function getPageTsString(): string
268265 }
269266 $ groupedByGroup [$ group ][$ cType ] = $ containerConfiguration ;
270267 }
271- if ($ containerConfiguration ['backendTemplate ' ] !== null ) {
272- $ pageTs .= LF . 'mod.web_layout.tt_content.preview {
268+ $ pageTs .= LF . 'mod.web_layout.tt_content.preview {
273269 ' . $ cType . ' = ' . $ containerConfiguration ['backendTemplate ' ] . '
274270}
275271 ' ;
276- }
277272 }
278273 $ typo3Version = GeneralUtility::makeInstance (Typo3Version::class);
279274 if ($ typo3Version ->getMajorVersion () > 12 ) {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ This is an example to create a 2 column container. The code snippet goes into a
7171| Method name | Description | Parameters | Default |
7272| ----------- | ----------- | ---------- | ---------- |
7373| ` setIcon ` | icon file, or existing icon identifier | ` string $icon ` | ` 'EXT:container/Resources/Public/Icons/Extension.svg' ` |
74- | ` setBackendTemplate ` | Template for backend view| ` string $backendTemplate ` | ` null '` |
74+ | ` setBackendTemplate ` | Template for backend view| ` string $backendTemplate ` | ` EXT:container/Resources/Private/Templates/Container.html '` |
7575| ` setGridTemplate ` | Template for grid | ` string $gridTemplate ` | ` 'EXT:container/Resources/Private/Templates/Container.html' ` |
7676| ` setGridPartialPaths ` / ` addGridPartialPath ` | Partial root paths for grid | ` array $gridPartialPaths ` / ` string $gridPartialPath ` | ` ['EXT:backend/Resources/Private/Partials/', 'EXT:container/Resources/Private/Partials/'] ` |
7777| ` setGridLayoutPaths ` | Layout root paths for grid | ` array $gridLayoutPaths ` | ` [] ` |
Original file line number Diff line number Diff line change 1+ < html
2+ xmlns:f ="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers "
3+ data-namespace-typo3-fluid ="true "
4+ >
5+ < f:comment >
6+ note: the tx_container_grid variable not set for TYPO3 v11,
7+ in TYPO3 v11 the ContainerPreviewRenderer renders the container grid after content from StandardContentPreviewRenderer
8+ in TYPO3 > v11 this variable is assigned in PageContentPreviewRendering EventListener
9+ in this case of backendLayout is set, not ContainerPreviewRenderer is used
10+ </ f:comment >
11+ < f:format .raw > {tx_container_grid}</ f:format .raw>
12+ </ html >
You can’t perform that action at this time.
0 commit comments