Resolves a cascade of TYPO3 v14 breaking changes that left every VITEC plugin's JSON output silently empty: 1. `list_type` column dropped — all renderer page-discovery queries now filter by `CType = 'vitec_X'`. 2. `#[AsAllowedCallable]` attribute added to every public render() — without it v14 throws AllowedCallableException, which headless silently filters via its "Oops, an error occurred!" guard. 3. `$GLOBALS['TSFE']->id` is null inside JSON cObj context — page id now read from the `frontend.page.information` request attribute (TSFE fallback kept for legacy entry points). 4. page.tsconfig wizard items migrated to `CType = vitec_X` directly (legacy `CType=list, list_type=...` no longer exists in v14). 5. ContainerChildrenProcessor + ContentElementResolver dispatch the PLUGIN_RENDERERS map by CType (primary) with list_type fallback. Beyond the bug fix this commit also contains: - Datasheets renderer rewritten to "products with newest datasheet" semantics (filtered via Download.hideondatasheets). - New vitec/card content block — multi-purpose card with backend preview and layout/background/aspect/alignment/border/shadow options. - New vitec_container CType (b13 single-column container, FlexForm cssClass propagated into the JSON envelope). - ContentElementResolver service for contentelement/contentelementcta link resolution; ContainerChildrenProcessor for nested plugin resolution inside b13 containers. - Vitecset setup.typoscript: ContentElement import moved to top so lib.contentElement is defined before VITEC's tt_content blocks. - Cleanup: 98 .bak.<timestamp> debugging backups removed; *.bak.* and /public/_assets_install/ added to .gitignore.
42 lines
2.0 KiB
PHP
Executable File
42 lines
2.0 KiB
PHP
Executable File
<?php
|
|
declare(strict_types=1);
|
|
|
|
defined('TYPO3') or die();
|
|
|
|
(static function (): void {
|
|
$l = 'LLL:EXT:vitec/Resources/Private/Language/locallang_pages.xlf:';
|
|
|
|
// Replace the default "Frontend Layout" dropdown on the page record
|
|
// (Page Properties → Appearance → Frontend Layout) with the VITEC layouts.
|
|
// Values are integer strings (DB column is INT).
|
|
$GLOBALS['TCA']['pages']['columns']['layout']['config']['items'] = [
|
|
['label' => $l . 'layout.0', 'value' => '0'],
|
|
['label' => $l . 'layout.1', 'value' => '1'],
|
|
['label' => $l . 'layout.2', 'value' => '2'],
|
|
['label' => $l . 'layout.3', 'value' => '3'],
|
|
['label' => $l . 'layout.4', 'value' => '4'],
|
|
['label' => $l . 'layout.5', 'value' => '5'],
|
|
['label' => $l . 'layout.6', 'value' => '6'],
|
|
['label' => $l . 'layout.7', 'value' => '7'],
|
|
['label' => $l . 'layout.8', 'value' => '8'],
|
|
['label' => $l . 'layout.9', 'value' => '9'],
|
|
['label' => $l . 'layout.10', 'value' => '10'],
|
|
['label' => $l . 'layout.11', 'value' => '11'],
|
|
['label' => $l . 'layout.12', 'value' => '12'],
|
|
['label' => $l . 'layout.13', 'value' => '13'],
|
|
['label' => $l . 'layout.14', 'value' => '14'],
|
|
['label' => $l . 'layout.15', 'value' => '15'],
|
|
['label' => $l . 'layout.16', 'value' => '16'],
|
|
['label' => $l . 'layout.17', 'value' => '17'],
|
|
['label' => $l . 'layout.18', 'value' => '18'],
|
|
['label' => $l . 'layout.19', 'value' => '19'],
|
|
['label' => $l . 'layout.20', 'value' => '20'],
|
|
];
|
|
$GLOBALS['TCA']['pages']['columns']['layout']['config']['default'] = '0';
|
|
|
|
// Hide the backend_layout / backend_layout_next_level fields from the editor —
|
|
// they are auto-synced from the frontend layout via SyncBackendLayoutHook.
|
|
$GLOBALS['TCA']['pages']['columns']['backend_layout']['displayCond'] = 'HIDE_FOR_NON_ADMINS';
|
|
$GLOBALS['TCA']['pages']['columns']['backend_layout_next_level']['displayCond'] = 'HIDE_FOR_NON_ADMINS';
|
|
})();
|