Structure per the agency agreement (Joe/Christina, confirmed 2026-10-23): /markets -> eleven market hero pages -> their sub-market pages; the use-case level stays sections on the sub-market pages. - new vitec:align-market-pages: renames 8 main market pages onto the agency names (slug change -> EXT:redirects), creates the 3 new markets, hides the dropped "Security & Surveillance" (records/stories untouched), reports unknown children. A child-slug pass realigns every child to <parent-slug>/<slugified-title> (DataHandler does not cascade slug changes; this also repaired the third embedded-slash slug, rtcc-/-rtic). --publish unhides the tree (dev convenience; element shells stay hidden) - sub-market import: all 24 agency workbooks applied (4 existing pages, 20 created) - their Meta sheets were clones of Corporate Environments (record_uid 32) and were repaired beforehand (market/sub-market set, record_uid 0; the record taxonomy alignment is a separate step) - SubmarketWorkbookImporter: page-properties parity (og/twitter titles and descriptions, canonical, abstract from the intro copy) and a placeholder upgrade pass - pages created in the same run only get the generic grey (their uid is still NEW), the re-run swaps it for the numbered per-page placeholder - new market hero pipeline: frontend layout 23 "Market Hero Page" (zones hero=colPos1, main=colPos0), Import\MarketHeroPageImporter + vitec:import-market-hero-workbooks (inbox migrations/markethero_xlsx_in, gitignored). Hero H1 travels on the introparagraph header (markethero has no headline field), the hero CTA anchors #submarkets, sub-market cards link their child page via t3://page, customerlogos and usecaselist ship hidden until filled editorially, prefooter ctabanner; full page-properties set with 11 curated keyword sets - applied end to end and live-verified (layout 23 heroes with linked cards, layout 21 sub pages with all six colPos groups, clean slugs) - spec v1.25 Open: market RECORD taxonomy (story badges / Solr facets still use the old 9 mains), featured product "ISR Video Mission Commander" has no record, the /markets main page workbook (template 2) is a separate flow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
149 lines
6.4 KiB
PHP
Executable File
149 lines
6.4 KiB
PHP
Executable File
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Evomedien\Vitec\View;
|
|
|
|
use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout;
|
|
use TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection;
|
|
use TYPO3\CMS\Backend\View\BackendLayout\DataProviderContext;
|
|
use TYPO3\CMS\Backend\View\BackendLayout\DataProviderInterface;
|
|
|
|
/**
|
|
* Provides one Backend Layout per VITEC frontend layout (pages.layout 0..20).
|
|
*
|
|
* Backend layout identifiers are the plain layout values: '0', '1', ... '20'.
|
|
* Combined with the provider id 'vitec' (registered in ext_localconf.php) this
|
|
* yields the standard combined identifier scheme vitec__<value>.
|
|
*
|
|
* The layout's title is shown above the page module and tells the editor
|
|
* which frontend layout is currently active.
|
|
*/
|
|
final class BackendLayoutDataProvider implements DataProviderInterface
|
|
{
|
|
/** colPos values across all VITEC backend layouts.
|
|
* Must NOT collide with container child colPos (>= 211). */
|
|
private const COL_POS = [
|
|
'main' => 0,
|
|
'hero' => 1,
|
|
'sidebar' => 2,
|
|
'preFooter' => 3,
|
|
// Sub-market template sections (spec 2026-10-01): one slot per Figma
|
|
// section. The headless JSON groups these as colPos110..colPos160 -
|
|
// that grouping IS the front-end contract for layout 21.
|
|
'smHero' => 110,
|
|
'smIntro' => 120,
|
|
'smWorkflow' => 130,
|
|
'smTestimonials' => 140,
|
|
'smProducts' => 150,
|
|
'smInsights' => 160,
|
|
];
|
|
|
|
/** Per-frontend-layout: title + ordered list of zones. */
|
|
public const LAYOUT_MAP = [
|
|
0 => ['title' => 'Default', 'zones' => ['main']],
|
|
1 => ['title' => 'Index Page', 'zones' => ['hero', 'main', 'preFooter']],
|
|
2 => ['title' => 'Markets Overview', 'zones' => ['hero', 'main']],
|
|
3 => ['title' => 'Market Detail', 'zones' => ['hero', 'main', 'sidebar']],
|
|
4 => ['title' => 'Solutions Overview', 'zones' => ['hero', 'main']],
|
|
5 => ['title' => 'Solution Detail', 'zones' => ['hero', 'main', 'sidebar']],
|
|
6 => ['title' => 'Use Cases Overview', 'zones' => ['hero', 'main']],
|
|
7 => ['title' => 'Use Case Detail', 'zones' => ['hero', 'main', 'sidebar']],
|
|
8 => ['title' => 'Products Overview', 'zones' => ['hero', 'main']],
|
|
9 => ['title' => 'Product Main Category', 'zones' => ['hero', 'main', 'preFooter']],
|
|
10 => ['title' => 'Product Detail', 'zones' => ['hero', 'main', 'sidebar']],
|
|
11 => ['title' => 'Support Overview', 'zones' => ['hero', 'main']],
|
|
12 => ['title' => 'News Overview', 'zones' => ['hero', 'main']],
|
|
13 => ['title' => 'News Detail V1', 'zones' => ['hero', 'main', 'sidebar']],
|
|
14 => ['title' => 'News Detail V2', 'zones' => ['hero', 'main']],
|
|
15 => ['title' => 'News Detail V3', 'zones' => ['hero', 'main', 'sidebar', 'preFooter']],
|
|
16 => ['title' => 'Content Page V1', 'zones' => ['hero', 'main']],
|
|
17 => ['title' => 'Content Page V2', 'zones' => ['hero', 'main', 'sidebar']],
|
|
18 => ['title' => 'Content Page V3', 'zones' => ['hero', 'main', 'sidebar', 'preFooter']],
|
|
19 => ['title' => 'Events Overview', 'zones' => ['hero', 'main']],
|
|
20 => ['title' => 'Contact Page', 'zones' => ['hero', 'main', 'sidebar']],
|
|
21 => ['title' => 'Sub-Market Page', 'zones' => ['smHero', 'smIntro', 'smWorkflow', 'smTestimonials', 'smProducts', 'smInsights']],
|
|
// Solution group hero pages (Joe's Template 06, import 2026-10-23) -
|
|
// same hero/main zones as layout 5, so the front end reuses parts.
|
|
22 => ['title' => 'Solution Group Page', 'zones' => ['hero', 'main']],
|
|
// Market hero pages (Joe's "Markets hero sub page", import 2026-10-23).
|
|
23 => ['title' => 'Market Hero Page', 'zones' => ['hero', 'main']],
|
|
];
|
|
|
|
/** Display name for each zone. Shown as column header in the BE page module. */
|
|
private const ZONE_NAMES = [
|
|
'main' => 'Main Content',
|
|
'hero' => 'Hero',
|
|
'sidebar' => 'Sidebar',
|
|
'preFooter' => 'Pre-Footer',
|
|
'smHero' => '1 · Hero',
|
|
'smIntro' => '2 · Intro',
|
|
'smWorkflow' => '3 · Workflow (header + flip cards)',
|
|
'smTestimonials' => '4 · Testimonials',
|
|
'smProducts' => '5 · Products (featured + list)',
|
|
'smInsights' => '6 · Industry Insights',
|
|
];
|
|
|
|
public function getIdentifier(): string
|
|
{
|
|
return 'vitec';
|
|
}
|
|
|
|
public function addBackendLayouts(DataProviderContext $dataProviderContext, BackendLayoutCollection $backendLayoutCollection)
|
|
{
|
|
foreach (self::LAYOUT_MAP as $value => $info) {
|
|
$backendLayoutCollection->add($this->buildBackendLayout((int)$value, $info['title'], $info['zones']));
|
|
}
|
|
}
|
|
|
|
public function getBackendLayout($identifier, $pageId)
|
|
{
|
|
$value = (int)$identifier;
|
|
if (!isset(self::LAYOUT_MAP[$value])) {
|
|
return null;
|
|
}
|
|
$info = self::LAYOUT_MAP[$value];
|
|
return $this->buildBackendLayout($value, $info['title'], $info['zones']);
|
|
}
|
|
|
|
/**
|
|
* @param string[] $zones
|
|
*/
|
|
private function buildBackendLayout(int $value, string $title, array $zones): BackendLayout
|
|
{
|
|
$rowsTs = '';
|
|
$rowNum = 1;
|
|
foreach ($zones as $zoneKey) {
|
|
$name = self::ZONE_NAMES[$zoneKey];
|
|
$colPos = self::COL_POS[$zoneKey];
|
|
$rowsTs .= <<<TS
|
|
{$rowNum} {
|
|
columns {
|
|
1 {
|
|
name = {$name}
|
|
colPos = {$colPos}
|
|
}
|
|
}
|
|
}
|
|
|
|
TS;
|
|
$rowNum++;
|
|
}
|
|
$rowCount = count($zones);
|
|
$configuration = <<<TS
|
|
backend_layout {
|
|
colCount = 1
|
|
rowCount = {$rowCount}
|
|
rows {
|
|
{$rowsTs} }
|
|
}
|
|
TS;
|
|
|
|
// Identifier is plain numeric; combined form becomes "vitec__<value>"
|
|
return new BackendLayout(
|
|
(string)$value,
|
|
'VITEC Layout: ' . $title,
|
|
$configuration
|
|
);
|
|
}
|
|
}
|