Created
August 18, 2023 13:08
-
-
Save helhum/9028fd8fb864c9b0cbd6585d3f082404 to your computer and use it in GitHub Desktop.
Add Topwire fields to tt_content elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | |
use TYPO3\CMS\Extbase\Utility\ExtensionUtility; | |
(static function (): void { | |
$columns = [ | |
'tx_turbo_wrap_in_frame' => [ | |
'label' => 'Wrap in Turbo frame', | |
'config' => [ | |
'type' => 'check', | |
], | |
], | |
'tx_turbo_propagate_url' => [ | |
'label' => 'Propagate URL', | |
'config' => [ | |
'type' => 'check', | |
], | |
], | |
'tx_turbo_morph' => [ | |
'label' => 'Morph', | |
'config' => [ | |
'type' => 'check', | |
], | |
], | |
'tx_turbo_frame_id' => [ | |
'label' => 'Frame id', | |
'config' => [ | |
'type' => 'input', | |
], | |
], | |
'tx_turbo_scope_frame' => [ | |
'label' => 'Scope frame id', | |
'config' => [ | |
'type' => 'check', | |
], | |
], | |
'tx_turbo_show_when_match' => [ | |
'label' => 'Only show element when scope matches', | |
'config' => [ | |
'type' => 'check', | |
], | |
], | |
]; | |
ExtensionManagementUtility::addTCAcolumns( | |
'tt_content', | |
$columns, | |
); | |
ExtensionManagementUtility::addToAllTCAtypes( | |
'tt_content', | |
'--div--;Topwire,tx_turbo_wrap_in_frame,tx_turbo_frame_id,tx_turbo_scope_frame,tx_turbo_propagate_url,tx_turbo_morph,tx_turbo_show_when_match', | |
); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tt_content.stdWrap.turboFrameWrap.field = tx_turbo_wrap_in_frame | |
tt_content.stdWrap.turboFrameWrap.frameId.field = tx_turbo_frame_id | |
tt_content.stdWrap.turboFrameWrap.scopeFrame.field = tx_turbo_scope_frame | |
tt_content.stdWrap.turboFrameWrap.propagateUrl.field = tx_turbo_propagate_url | |
tt_content.stdWrap.turboFrameWrap.morph.field = tx_turbo_morph | |
tt_content.stdWrap.turboFrameWrap.path = tt_content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE tt_content ( | |
tx_turbo_wrap_in_frame tinyint(4) unsigned DEFAULT '0' NOT NULL, | |
tx_turbo_propagate_url tinyint(4) unsigned DEFAULT '0' NOT NULL, | |
tx_turbo_morph tinyint(4) unsigned DEFAULT '0' NOT NULL, | |
tx_turbo_frame_id text, | |
tx_turbo_scope_frame tinyint(4) unsigned DEFAULT '0' NOT NULL, | |
); |
I added
tx_turbo_show_when_match tinyint(4) unsigned DEFAULT '0' NOT NULL,
and
tt_content.stdWrap.turboFrameWrap.turboShowWhenMatch.field = tx_turbo_show_when_match
to make it work.
@Chrisswald What do you use this experimental (and undocumented) feature for? I was considering removing it tbh.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tx_turbo_show_when_match is missing in ext_tables.sql and typoscript