Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[!!!][FEATURE] Override any backend template with TsConfig
This patch finishes the migration to the new backend templating strategy. Affected are the backend page module and the dashboard extension: * Bigger refactoring of PageLayoutController towards more modern and streamlined code with much less class state. * Transition of fillDefaultsByPackageName() in the page module for the "grid" layout towards TsConfig based template overrides. * Refactoring of the dashboard main controller to avoid fillDefaultsByPackageName(). The new template override API based on TsConfig is now documented with a feature ReST file. The new template override strategy is breaking for existing overrides based on FE TypoScript and documented with a breaking ReST file including a detailed migration path. The ext:dashboard documentation is adapted accordingly. As a result, all backend controllers that do not rely on extbase no longer parse FE TypoScript. This is especially useful for the central page module: Clicking around on a v12 bootstrap_package page tree in the page module without the patch leads to around 80 to 120 milliseconds parsetime on my machine - depending on the number and complexity of content elements and the cache state. This systematically shrinks to around 50 to 70 milliseconds with the patch: The system no longer loads tons of extbase related classes, dependency injection is more effective, and the entire FE TypoScript parsing is gone. With cold caches ("Flush all caches" backend button), the difference is around 100 milliseconds for the first call on my system - in general, the bigger the instance, the higher the improvement. Change-Id: Ia244495db592526633d01e7f504502e297bd2ef9 Resolves: #96812 Related: #96730 Related: #96614 Related: #90348 Releases: main Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73366 Tested-by: core-ci <typo3@b13.com> Tested-by: Stefan Bürk <stefan@buerk.tech> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Benni Mack <benni@typo3.org>
- Loading branch information
Showing
43 changed files
with
1,393 additions
and
1,462 deletions.
There are no files selected for viewing
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
722 changes: 246 additions & 476 deletions
722
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
2 changes: 1 addition & 1 deletion
2
typo3/sysext/backend/Resources/Private/Partials/PageLayout/Grid/Column.html
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
66 changes: 66 additions & 0 deletions
66
typo3/sysext/backend/Resources/Private/Templates/PageLayout/PageModule.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<html | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
data-namespace-typo3-fluid="true" | ||
> | ||
|
||
<f:layout name="Module" /> | ||
|
||
<f:section name="Content"> | ||
|
||
<f:be.pageRenderer | ||
includeRequireJsModules="{ | ||
0: 'TYPO3/CMS/Recordlist/ClearCache', | ||
1: 'TYPO3/CMS/Backend/NewContentElementWizardButton', | ||
2: 'TYPO3/CMS/Backend/ContextMenu', | ||
3: 'TYPO3/CMS/Backend/Tooltip', | ||
4: 'TYPO3/CMS/Backend/Localization', | ||
5: 'TYPO3/CMS/Backend/LayoutModule/DragDrop', | ||
6: 'TYPO3/CMS/Backend/Modal' | ||
}" | ||
/> | ||
|
||
<f:variable name="immediateActionArgs" value="{0: 'web', 1: pageId, 2: 1}" /> | ||
<typo3-immediate-action action="TYPO3.Backend.Storage.ModuleStateStorage.updateWithCurrentMount" args="{immediateActionArgs -> f:format.json() -> f:format.htmlspecialchars()}"></typo3-immediate-action> | ||
|
||
<f:for each="{infoBoxes}" as="infoBox"> | ||
<f:be.infobox title="{infoBox.title}" state="{infoBox.state}"> | ||
<f:format.raw>{infoBox.message}</f:format.raw> | ||
</f:be.infobox> | ||
</f:for> | ||
|
||
<f:if condition="{isPageEditable}"> | ||
<f:then> | ||
<h1 class="t3js-title-inlineedit">{localizedPageTitle}</h1> | ||
</f:then> | ||
<f:else> | ||
<h1>{localizedPageTitle}</h1> | ||
</f:else> | ||
</f:if> | ||
|
||
<f:format.raw>{eventContentHtmlTop}</f:format.raw> | ||
|
||
<form action="{f:be.uri(route:'web_layout', parameters:'{id: pageId}')}" id="PageLayoutController" method="post"> | ||
<f:format.raw>{mainContentHtml}</f:format.raw> | ||
</form> | ||
|
||
<f:if condition="{hiddenElementsShowToggle}"> | ||
<div class="form-check"> | ||
<input | ||
type="checkbox" | ||
id="checkTt_content_showHidden" | ||
class="form-check-input" | ||
name="SET[tt_content_showHidden]" | ||
value="1" | ||
{f:if(condition:'{hiddenElementsState} == 1', then:'checked="checked"')} | ||
/> | ||
<label class="form-check-label" for="checkTt_content_showHidden"> | ||
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:hiddenCE" /> (<span class="t3js-hidden-counter">{hiddenElementsCount}</span>) | ||
</label> | ||
</div> | ||
</f:if> | ||
|
||
<f:format.raw>{eventContentHtmlBottom}</f:format.raw> | ||
|
||
</f:section> | ||
|
||
</html> |
21 changes: 21 additions & 0 deletions
21
typo3/sysext/backend/Resources/Private/Templates/PageLayout/PageModuleNoAccess.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<html | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
data-namespace-typo3-fluid="true" | ||
> | ||
|
||
<f:layout name="Module" /> | ||
|
||
<f:section name="Content"> | ||
|
||
<f:variable name="immediateActionArgs" value="{0: 'web', 1: pageId}" /> | ||
<typo3-immediate-action action="TYPO3.Backend.Storage.ModuleStateStorage.update" args="{immediateActionArgs -> f:format.json() -> f:format.htmlspecialchars()}"></typo3-immediate-action> | ||
|
||
<h1>{siteName}</h1> | ||
|
||
<f:be.infobox title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:clickAPage_header')}" state="-1"> | ||
<f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:clickAPage_content" /> | ||
</f:be.infobox> | ||
|
||
</f:section> | ||
|
||
</html> |
Oops, something went wrong.