Skip to content

Commit 081f488

Browse files
committed
[!!!][TASK] Migrate to Site Sets and remove obsolete PageTsConfig registrations
This commit modernizes the Bootstrap Package for TYPO3 13 by fully embracing Site Sets and removing legacy configuration approaches. The registerPageTSConfigFile calls have been removed from all TCA override files since content elements are now automatically registered to the new content element wizard via TCA configuration in TYPO3 13. This also means the mod.wizards.newContentElement PageTsConfig files are no longer needed and have been deleted. Backend layouts are now configurable via site settings, allowing users to enable or disable individual layouts through the site configuration. A new siteSetting() expression language function has been added to support conditional PageTsConfig based on these settings. The extension configuration has been simplified by removing the obsolete PageTS toggle options which are now provided via Site Sets. Only the feature flags disableCssProcessing and disableGoogleFontCaching remain. The documentation has been completely rewritten to reflect the migration from TypoScript constants to Site Settings. Each Site Set now has its own dedicated documentation page. The outdated AdministratorManual and migration guides have been removed. Legacy TsConfig files like TCADefaults.tsconfig, TCEFORM.tsconfig and TCEMAIN.tsconfig have been cleaned up as these configurations are now provided via Site Sets.
1 parent 6522d0b commit 081f488

File tree

127 files changed

+467
-1693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+467
-1693
lines changed

Classes/ExpressionLanguage/ConditionProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
declare(strict_types = 1);
2+
declare(strict_types=1);
33

44
/*
55
* This file is part of the package bk2k/bootstrap-package.
@@ -24,5 +24,8 @@ public function __construct()
2424
'extension' => GeneralUtility::makeInstance(ExtensionWrapper::class),
2525
'extensionConfiguration' => GeneralUtility::makeInstance(ExtensionConfigurationWrapper::class),
2626
];
27+
$this->expressionLanguageProviders = [
28+
FunctionsProvider::class,
29+
];
2730
}
2831
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
/*
5+
* This file is part of the package bk2k/bootstrap-package.
6+
*
7+
* For the full copyright and license information, please read the
8+
* LICENSE file that was distributed with this source code.
9+
*/
10+
11+
namespace BK2K\BootstrapPackage\ExpressionLanguage;
12+
13+
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
14+
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
15+
use TYPO3\CMS\Core\Exception\SiteNotFoundException;
16+
use TYPO3\CMS\Core\Site\SiteFinder;
17+
use TYPO3\CMS\Core\Utility\GeneralUtility;
18+
19+
/**
20+
* Provides custom expression language functions for TypoScript/PageTsConfig conditions.
21+
*/
22+
class FunctionsProvider implements ExpressionFunctionProviderInterface
23+
{
24+
/**
25+
* @return ExpressionFunction[]
26+
*/
27+
public function getFunctions(): array
28+
{
29+
return [
30+
$this->getSiteSettingFunction(),
31+
];
32+
}
33+
34+
protected function getSiteSettingFunction(): ExpressionFunction
35+
{
36+
return new ExpressionFunction(
37+
'siteSetting',
38+
static fn () => null, // Not used for compilation
39+
static function (array $arguments, string $settingKey, mixed $default = null): mixed {
40+
// Try to get page from the expression language context
41+
$pageId = 0;
42+
if (isset($arguments['page']['uid'])) {
43+
$pageId = (int)$arguments['page']['uid'];
44+
}
45+
46+
if ($pageId <= 0) {
47+
return $default;
48+
}
49+
50+
try {
51+
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
52+
$site = $siteFinder->getSiteByPageId($pageId);
53+
$settings = $site->getSettings();
54+
return $settings->get($settingKey, $default);
55+
} catch (SiteNotFoundException) {
56+
return $default;
57+
}
58+
}
59+
);
60+
}
61+
}
Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,51 @@
1-
@import './BackendLayouts/'
1+
[siteSetting("backendlayout.default", true) == true]
2+
@import './BackendLayouts/default.tsconfig'
3+
[end]
24

5+
[siteSetting("backendlayout.simple", true) == true]
6+
@import './BackendLayouts/simple.tsconfig'
7+
[end]
8+
9+
[siteSetting("backendlayout.2_columns", true) == true]
10+
@import './BackendLayouts/2_columns.tsconfig'
11+
[end]
12+
13+
[siteSetting("backendlayout.2_columns_25_75", true) == true]
14+
@import './BackendLayouts/2_columns_25_75.tsconfig'
15+
[end]
16+
17+
[siteSetting("backendlayout.2_columns_50_50", true) == true]
18+
@import './BackendLayouts/2_columns_50_50.tsconfig'
19+
[end]
20+
21+
[siteSetting("backendlayout.2_columns_offset_right", true) == true]
22+
@import './BackendLayouts/2_columns_offset_right.tsconfig'
23+
[end]
24+
25+
[siteSetting("backendlayout.3_columns", true) == true]
26+
@import './BackendLayouts/3_columns.tsconfig'
27+
[end]
28+
29+
[siteSetting("backendlayout.special_feature", true) == true]
30+
@import './BackendLayouts/special_feature.tsconfig'
31+
[end]
32+
33+
[siteSetting("backendlayout.special_start", true) == true]
34+
@import './BackendLayouts/special_start.tsconfig'
35+
[end]
36+
37+
[siteSetting("backendlayout.subnavigation_left", true) == true]
38+
@import './BackendLayouts/subnavigation_left.tsconfig'
39+
[end]
40+
41+
[siteSetting("backendlayout.subnavigation_left_2_columns", true) == true]
42+
@import './BackendLayouts/subnavigation_left_2_columns.tsconfig'
43+
[end]
44+
45+
[siteSetting("backendlayout.subnavigation_right", true) == true]
46+
@import './BackendLayouts/subnavigation_right.tsconfig'
47+
[end]
48+
49+
[siteSetting("backendlayout.subnavigation_right_2_columns", true) == true]
50+
@import './BackendLayouts/subnavigation_right_2_columns.tsconfig'
51+
[end]
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
categories:
2+
BootstrapPackage:
3+
label: 'Bootstrap Package'
4+
BootstrapPackage.backendLayouts:
5+
label: 'Backend Layouts'
6+
parent: BootstrapPackage
7+
8+
settings:
9+
10+
# Backend Layouts
11+
backendlayout.default:
12+
label: 'Enable Default Layout'
13+
description: 'Enable the default backend layout with border, content before/after, main content and footer columns.'
14+
category: BootstrapPackage.backendLayouts
15+
type: bool
16+
default: true
17+
18+
backendlayout.simple:
19+
label: 'Enable Simple Layout'
20+
description: 'Enable the simple backend layout with border, content before/after and main content columns.'
21+
category: BootstrapPackage.backendLayouts
22+
type: bool
23+
default: true
24+
25+
backendlayout.2_columns:
26+
label: 'Enable 2 Columns Layout'
27+
description: 'Enable the 2 columns (75/25) backend layout.'
28+
category: BootstrapPackage.backendLayouts
29+
type: bool
30+
default: true
31+
32+
backendlayout.2_columns_25_75:
33+
label: 'Enable 2 Columns 25/75 Layout'
34+
description: 'Enable the 2 columns (25/75) backend layout.'
35+
category: BootstrapPackage.backendLayouts
36+
type: bool
37+
default: true
38+
39+
backendlayout.2_columns_50_50:
40+
label: 'Enable 2 Columns 50/50 Layout'
41+
description: 'Enable the 2 columns (50/50) backend layout.'
42+
category: BootstrapPackage.backendLayouts
43+
type: bool
44+
default: true
45+
46+
backendlayout.2_columns_offset_right:
47+
label: 'Enable 2 Columns Offset Right Layout'
48+
description: 'Enable the 2 columns offset right backend layout.'
49+
category: BootstrapPackage.backendLayouts
50+
type: bool
51+
default: true
52+
53+
backendlayout.3_columns:
54+
label: 'Enable 3 Columns Layout'
55+
description: 'Enable the 3 columns backend layout.'
56+
category: BootstrapPackage.backendLayouts
57+
type: bool
58+
default: true
59+
60+
backendlayout.special_feature:
61+
label: 'Enable Special Feature Layout'
62+
description: 'Enable the special feature backend layout.'
63+
category: BootstrapPackage.backendLayouts
64+
type: bool
65+
default: true
66+
67+
backendlayout.special_start:
68+
label: 'Enable Special Start Layout'
69+
description: 'Enable the special start backend layout.'
70+
category: BootstrapPackage.backendLayouts
71+
type: bool
72+
default: true
73+
74+
backendlayout.subnavigation_left:
75+
label: 'Enable Subnavigation Left Layout'
76+
description: 'Enable the subnavigation left backend layout.'
77+
category: BootstrapPackage.backendLayouts
78+
type: bool
79+
default: true
80+
81+
backendlayout.subnavigation_left_2_columns:
82+
label: 'Enable Subnavigation Left 2 Columns Layout'
83+
description: 'Enable the subnavigation left with 2 columns backend layout.'
84+
category: BootstrapPackage.backendLayouts
85+
type: bool
86+
default: true
87+
88+
backendlayout.subnavigation_right:
89+
label: 'Enable Subnavigation Right Layout'
90+
description: 'Enable the subnavigation right backend layout.'
91+
category: BootstrapPackage.backendLayouts
92+
type: bool
93+
default: true
94+
95+
backendlayout.subnavigation_right_2_columns:
96+
label: 'Enable Subnavigation Right 2 Columns Layout'
97+
description: 'Enable the subnavigation right with 2 columns backend layout.'
98+
category: BootstrapPackage.backendLayouts
99+
type: bool
100+
default: true

Configuration/Sets/ContentElements/PageTsConfig/Elements.tsconfig

Lines changed: 0 additions & 1 deletion
This file was deleted.

Configuration/Sets/ContentElements/PageTsConfig/Elements/Accordion.tsconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

Configuration/Sets/ContentElements/PageTsConfig/Elements/Audio.tsconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

Configuration/Sets/ContentElements/PageTsConfig/Elements/Bullets.tsconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

Configuration/Sets/ContentElements/PageTsConfig/Elements/CardGroup.tsconfig

Lines changed: 0 additions & 26 deletions
This file was deleted.

Configuration/Sets/ContentElements/PageTsConfig/Elements/Carousel.tsconfig

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)