- new project-neutral extension evo_megamenu_json (Evomedien): a Megamenu plugin holding entries, columns, items, teaser cards and a featured slot as nested records; presentation settings travel with the payload so the front end reads behaviour instead of hard-coding it; published as page.10.fields.megaMenu, driven by the site settings megamenu.contentUid and megamenu.storagePid - vitec:seed-megamenu fills one element from the live structure: 5 entries, 26 columns, 95 items, 4 story cards; items without a page yet are flagged pending so the front end falls back to the column link - vitec:debug-sets prints the resolved site set order - read-only diagnostics: check_megamenu_schema.php, check_typoscript_templates.php - docs: schema updates run via extension:setup (database:updateschema no longer exists in v14), and a JSON Accept header activates headless-mixed, which strips every set-added page field
65 lines
2.4 KiB
PHP
65 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
defined('TYPO3') or die();
|
|
|
|
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
|
|
|
/**
|
|
* Registers the "Megamenu" plugin (CType evomegamenujson_megamenu).
|
|
*
|
|
* The element carries the whole menu: its entries live inline below it, and
|
|
* the FlexForm holds the presentation settings the front end reads back out
|
|
* of the JSON (stage, hover behaviour, column count, labels).
|
|
*
|
|
* Place ONE element per menu - typically on a sysfolder - and point the site
|
|
* setting `megamenu.contentUid` at it to expose the menu at page level.
|
|
*/
|
|
(static function (): void {
|
|
ExtensionUtility::registerPlugin(
|
|
'EvoMegamenuJson',
|
|
'Megamenu',
|
|
'LLL:EXT:evo_megamenu_json/Resources/Private/Language/locallang_db.xlf:plugin.megamenu',
|
|
'evomegamenujson-plugin',
|
|
'menu',
|
|
'LLL:EXT:evo_megamenu_json/Resources/Private/Language/locallang_db.xlf:plugin.megamenu.description',
|
|
'FILE:EXT:evo_megamenu_json/Configuration/FlexForms/Megamenu.xml'
|
|
);
|
|
|
|
$ll = 'LLL:EXT:evo_megamenu_json/Resources/Private/Language/locallang_db.xlf:';
|
|
|
|
$GLOBALS['TCA']['tt_content']['columns']['tx_evomegamenujson_entries'] = [
|
|
'label' => $ll . 'tt_content.entries',
|
|
'description' => $ll . 'tt_content.entries.description',
|
|
'config' => [
|
|
'type' => 'inline',
|
|
'foreign_table' => 'tx_evomegamenujson_entry',
|
|
'foreign_field' => 'parentid',
|
|
'foreign_table_field' => 'parenttable',
|
|
'foreign_sortby' => 'sorting',
|
|
'maxitems' => 12,
|
|
'appearance' => [
|
|
'collapseAll' => true,
|
|
'expandSingle' => true,
|
|
'useSortable' => true,
|
|
'newRecordLinkAddTitle' => true,
|
|
'levelLinksPosition' => 'top',
|
|
],
|
|
],
|
|
];
|
|
|
|
$GLOBALS['TCA']['tt_content']['types']['evomegamenujson_megamenu']['showitem'] = '
|
|
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
|
|
--palette--;;general,
|
|
header,
|
|
--div--;' . $ll . 'tt_content.tab.entries,
|
|
tx_evomegamenujson_entries,
|
|
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:plugin,
|
|
pi_flexform,
|
|
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
|
|
--palette--;;hidden,
|
|
--palette--;;access,
|
|
';
|
|
})();
|