Files
VITEC-website/packages/vitec/Classes/View/VitecBackendLayoutView.php
o-rasche 409afc2433 VITEC headless: ContentElementResolver, Product fields (videofile, showdatapath)
- New Classes/Service/ContentElementResolver.php: parses TYPO3 typolink
  (t3://record?identifier=tt_content&uid=N, t3://page?uid=P#N, plain numeric)
  to a normalised tt_content envelope ({id,type,colPos,sorting,appearance,
  data}), recursively resolving any nested VITEC list-plugin children.
- ProductListJsonRenderer / ProductShowJsonRenderer: contentelement and
  contentelementcta now emit the resolved object instead of the raw
  typolink string (breaking change at those two keys).
- Product model: new field videofile (FAL, single video upload in tab
  Images and Videos, mp4/webm/ogv/mov/m4v); new bool field showdatapath
  (toggle at end of General tab, controls the "Datapath is now Vitec"
  graphic in the frontend). ext_tables.sql, TCA, model property +
  getter/setter, and both renderers updated accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-05 10:34:49 +02:00

30 lines
891 B
PHP

<?php
declare(strict_types=1);
namespace Evomedien\Vitec\View;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\BackendLayoutView;
/**
* Overrides BackendLayoutView so the page module always reflects pages.layout
* without the editor having to set backend_layout manually.
*/
final class VitecBackendLayoutView extends BackendLayoutView
{
public function getSelectedCombinedIdentifier(int $pageId): string|false
{
if ($pageId <= 0) {
return parent::getSelectedCombinedIdentifier($pageId);
}
$page = BackendUtility::getRecord('pages', $pageId, 'layout');
if (!is_array($page) || !isset($page['layout'])) {
return parent::getSelectedCombinedIdentifier($pageId);
}
// Combined identifier format: "<dataProvider>__<layoutId>"
return 'vitec__' . (int)$page['layout'];
}
}