From 24d12710869f9775fd95b621a5ed4df3f76131fb Mon Sep 17 00:00:00 2001 From: Achim Fritz Date: Fri, 31 Oct 2025 18:28:58 +0100 Subject: [PATCH] [BUGFIX] html markup adapt PageLayout Partials to current TYPO3 markup * 13.4.20 * 12.4.39 Fixes: #638 --- .../Partials/PageLayout/Grid/Column.html | 36 +++++++++---- .../PageLayout/Grid/ColumnHeader.html | 50 ++++++++++--------- .../Private/Partials/PageLayout/Record.html | 36 +++++++------ .../Partials12/PageLayout/Grid/Column.html | 19 +++++-- .../PageLayout/Grid/ColumnHeader.html | 22 ++++---- .../Private/Partials12/PageLayout/Record.html | 36 +++++++------ .../Backend/ContentDefenderCest.php | 21 +++----- Tests/Acceptance/Backend/LayoutCest.php | 12 ++--- Tests/Acceptance/Support/BackendTester.php | 10 ++++ 9 files changed, 141 insertions(+), 101 deletions(-) diff --git a/Resources/Private/Partials/PageLayout/Grid/Column.html b/Resources/Private/Partials/PageLayout/Grid/Column.html index d4e9a3ad..e44eaf9f 100644 --- a/Resources/Private/Partials/PageLayout/Grid/Column.html +++ b/Resources/Private/Partials/PageLayout/Grid/Column.html @@ -4,20 +4,36 @@ + + + + + + + + + + + + t3js-page-column t3-grid-cell t3-page-column + {f:if(condition: column.identifierCleaned, then: 't3-grid-cell-{column.identifierCleaned}')} + {f:if(condition: column.unassigned, then: 't3-grid-cell-unassigned')} + {f:if(condition: '!{column.active} && !{column.unused}', then: 't3-grid-cell-restricted')} + {f:if(condition: '!{column.active} && {hideRestrictedColumns} && !{column.unused}', then: 't3-grid-cell-hidden')} + + - + data-colpos="{colpos}" data-language-uid="{column.context.siteLanguage.languageId}" + data-tx-container-parent="{column.containerUid}" + class="{columnClasses -> f:spaceless()}" + role="group" aria-labelledby="{columnIdentifier}"> + + +
+ class=" t3-page-ce-wrapper"> diff --git a/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html b/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html index bcd5a623..3d817fe2 100644 --- a/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html +++ b/Resources/Private/Partials/PageLayout/Grid/ColumnHeader.html @@ -1,45 +1,47 @@ +{columnHeaderLevel -> f:or(alternative: 2) -> f:variable(name: 'columnHeaderLevel')} +
- {column.title} + {column.title} - + - {column.titleUnassigned} + {column.titleUnassigned} - {column.titleInaccessible} + {column.titleInaccessible}
{column.beforeSectionMarkup} -
-
- - - - - - - - - - - - - -
+
+ + + + + + + + + + +
diff --git a/Resources/Private/Partials/PageLayout/Record.html b/Resources/Private/Partials/PageLayout/Record.html index c49be67f..23d64ee6 100644 --- a/Resources/Private/Partials/PageLayout/Record.html +++ b/Resources/Private/Partials/PageLayout/Record.html @@ -1,13 +1,17 @@ -{f:if(condition: '{item.disabled} && {item.context.drawingConfiguration.showHidden} == 0', then: 'display: none;') -> f:variable(name: 'style')} -
f:variable(name: 'style')} +
-
+ id={item.record.uid} - {item.record.header} - {item.contentTypeLabel} +
@@ -19,23 +23,23 @@ + + +
- + - - - +
diff --git a/Resources/Private/Partials12/PageLayout/Grid/Column.html b/Resources/Private/Partials12/PageLayout/Grid/Column.html index d4e9a3ad..d9c99d50 100644 --- a/Resources/Private/Partials12/PageLayout/Grid/Column.html +++ b/Resources/Private/Partials12/PageLayout/Grid/Column.html @@ -4,19 +4,28 @@ + + + + + + + + + + + t3-gridCell-height{column.rowSpan}" role="group" aria-labelledby="{columnIdentifier}"> -
diff --git a/Resources/Private/Partials12/PageLayout/Grid/ColumnHeader.html b/Resources/Private/Partials12/PageLayout/Grid/ColumnHeader.html index 06c24180..8cacf2df 100644 --- a/Resources/Private/Partials12/PageLayout/Grid/ColumnHeader.html +++ b/Resources/Private/Partials12/PageLayout/Grid/ColumnHeader.html @@ -3,19 +3,21 @@
- + + +
- {column.title} + {column.title}
- + - {column.titleUnassigned} + {column.titleUnassigned} - {column.titleInaccessible} + {column.titleInaccessible}
@@ -26,16 +28,14 @@ - + - - + + + diff --git a/Resources/Private/Partials12/PageLayout/Record.html b/Resources/Private/Partials12/PageLayout/Record.html index 435fdb33..c22a6bd5 100644 --- a/Resources/Private/Partials12/PageLayout/Record.html +++ b/Resources/Private/Partials12/PageLayout/Record.html @@ -1,13 +1,16 @@ -{f:if(condition: '{item.disabled} && {item.context.drawingConfiguration.showHidden} == 0', then: 'display: none;') -> f:variable(name: 'style')} -
f:variable(name: 'style')} +
-
+ id={item.record.uid} - {item.record.header} - {item.contentTypeLabel} +
@@ -19,22 +22,25 @@ + + +
- + - - + + + diff --git a/Tests/Acceptance/Backend/ContentDefenderCest.php b/Tests/Acceptance/Backend/ContentDefenderCest.php index efcb31e9..fa31f489 100644 --- a/Tests/Acceptance/Backend/ContentDefenderCest.php +++ b/Tests/Acceptance/Backend/ContentDefenderCest.php @@ -43,10 +43,8 @@ public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsD $I->wait(0.5); $I->switchToContentFrame(); $dataColPos = $I->getDataColPos(300, 200); - $I->waitForElement('#element-tt_content-300 [data-colpos="' . $dataColPos . '"]'); - $newContentElementLabel = $I->getNewContentElementLabel(); - - $I->click($newContentElementLabel, '#element-tt_content-300 [data-colpos="' . $dataColPos . '"]'); + $colPosSelector = '#element-tt_content-300 [data-colpos="' . $dataColPos . '"]'; + $I->clickNewContentElement($colPosSelector); $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) { @@ -72,9 +70,8 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(Backe $I->wait(0.5); $I->switchToContentFrame(); $dataColPos = $I->getDataColPos(800, 200); - $I->waitForElement('#element-tt_content-800 [data-colpos="' . $dataColPos . '"]'); - $newContentElementLabel = $I->getNewContentElementLabel(); - $I->click($newContentElementLabel, '#element-tt_content-800 [data-colpos="' . $dataColPos . '"]'); + $colPosSelector = '#element-tt_content-800 [data-colpos="' . $dataColPos . '"]'; + $I->clickNewContentElement($colPosSelector); $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) { @@ -153,9 +150,8 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl $I->wait(0.5); $I->switchToContentFrame(); $dataColPos = $I->getDataColPos(801, 200); - $I->waitForElement('#element-tt_content-801 [data-colpos="' . $dataColPos . '"]'); - $newContentElementLabel = $I->getNewContentElementLabel(); - $I->click($newContentElementLabel, '#element-tt_content-801 [data-colpos="' . $dataColPos . '"]'); + $colPosSelector = '#element-tt_content-801 [data-colpos="' . $dataColPos . '"]'; + $I->clickNewContentElement($colPosSelector); $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) { @@ -253,9 +249,8 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer( $I->wait(0.5); $I->switchToContentFrame(); $dataColPos = $I->getDataColPos(402, 202); - $I->waitForElement('#element-tt_content-402 [data-colpos="' . $dataColPos . '"]'); - $newContentElementLabel = $I->getNewContentElementLabel(); - $I->click($newContentElementLabel, '#element-tt_content-402 [data-colpos="' . $dataColPos . '"]'); + $colPosSelector = '#element-tt_content-402 [data-colpos="' . $dataColPos . '"]'; + $I->clickNewContentElement($colPosSelector); $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) { diff --git a/Tests/Acceptance/Backend/LayoutCest.php b/Tests/Acceptance/Backend/LayoutCest.php index e34de03b..e5e77c2e 100644 --- a/Tests/Acceptance/Backend/LayoutCest.php +++ b/Tests/Acceptance/Backend/LayoutCest.php @@ -264,9 +264,8 @@ public function newElementInHeaderColumnHasExpectedColPosAndParentSelected(Backe $I->switchToContentFrame(); // header $dataColPos = $I->getDataColPos(700, 200); - $I->waitForElement('#element-tt_content-700 [data-colpos="' . $dataColPos . '"]'); - $newContentElementLabel = $I->getNewContentElementLabel(); - $I->click($newContentElementLabel, '#element-tt_content-700 [data-colpos="' . $dataColPos . '"]'); + $colPosSelector = '#element-tt_content-700 [data-colpos="' . $dataColPos . '"]'; + $I->clickNewContentElement($colPosSelector); // "[data-colpos="700-200"]" can be attribute of "td" or "div" tag, depends if Fluid based page module is enabled $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); @@ -311,8 +310,7 @@ public function canCreateContentElementInContainer(BackendTester $I, PageTree $p $I->waitForElement($containerColumn); $typo3Version = GeneralUtility::makeInstance(Typo3Version::class); $I->dontSeeElement($contentInContainerColumn); - $newContentElementLabel = $I->getNewContentElementLabel(); - $I->click($newContentElementLabel, $containerColumn); + $I->clickNewContentElement($containerColumn); $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); if ($typo3Version->getMajorVersion() < 12) { @@ -369,8 +367,8 @@ public function canCreateContentElementInTranslatedContainerInFreeMode(BackendTe $selector = '#element-tt_content-' . $uid . ' div:nth-child(1) div:nth-child(2)'; $I->dontSee('german', $selector); $dataColPos = $I->getDataColPos($uid, 200); - $newContentElementLabel = $I->getNewContentElementLabel(); - $I->click($newContentElementLabel, '#element-tt_content-' . $uid . ' [data-colpos="' . $dataColPos . '"]'); + $colPosSelector = '#element-tt_content-' . $uid . ' [data-colpos="' . $dataColPos . '"]'; + $I->clickNewContentElement($colPosSelector); $I->switchToIFrame(); $I->waitForElement('.modal-dialog'); $typo3Version = GeneralUtility::makeInstance(Typo3Version::class); diff --git a/Tests/Acceptance/Support/BackendTester.php b/Tests/Acceptance/Support/BackendTester.php index a5f43f77..2853eae6 100644 --- a/Tests/Acceptance/Support/BackendTester.php +++ b/Tests/Acceptance/Support/BackendTester.php @@ -53,6 +53,16 @@ public function getDataColPos(int $containerId, int $colPos): string return (string)($containerId . '-' . $colPos); } + public function clickNewContentElement(string $colPosSelector): void + { + $this->waitForElement($colPosSelector); + if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 12) { + $this->click('Content', $colPosSelector); + return; + } + $this->click($colPosSelector . ' typo3-backend-new-content-element-wizard-button'); + } + public function getNewContentElementLabel(): string { if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 12) {