Skip to content

Commit ecf3faa

Browse files
fix: conditionally render widget title based on TYPO3 version
1 parent f1cb9da commit ecf3faa

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

Classes/Widgets/InternalNewsWidget.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
namespace Xima\XimaTypo3InternalNews\Widgets;
2525

2626
use Psr\Http\Message\ServerRequestInterface;
27+
use TYPO3\CMS\Core\Information\Typo3Version;
2728
use TYPO3\CMS\Core\Page\JavaScriptModuleInstruction;
29+
use TYPO3\CMS\Core\Utility\GeneralUtility;
2830
use TYPO3\CMS\Dashboard\Widgets\AdditionalCssInterface;
2931
use TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface;
3032
use TYPO3\CMS\Dashboard\Widgets\JavaScriptInterface;
@@ -55,6 +57,7 @@ public function renderWidgetContent(): string
5557
'records' => $this->dataProvider->getItems(),
5658
'buttons' => $GLOBALS['BE_USER']->check('tables_modify', 'tx_ximatypo3internalnews_domain_model_news') ? $this->buttons : null,
5759
'options' => $this->options,
60+
'version' => GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion(),
5861
]
5962
);
6063
}

Resources/Private/Templates/Backend/Widgets/List.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers"
44
data-namespace-typo3-fluid="true">
55

6-
<div class="widget-content-title d-flex" style="gap:10px;">
7-
<core:icon identifier="internal-news-news-color" size="small" alternativeMarkupIdentifier="inline"/>
8-
<span><f:translate key="widget.title" extensionName="XimaTypo3InternalNews"/></span>
9-
</div>
6+
<f:if condition="{version} < 13">
7+
<div class="widget-content-title d-flex" style="gap:10px;">
8+
<core:icon identifier="internal-news-news-color" size="small" alternativeMarkupIdentifier="inline"/>
9+
<span><f:translate key="widget.title" extensionName="XimaTypo3InternalNews"/></span>
10+
</div>
11+
</f:if>
1012
<div class="widget-content-main"
1113
style="--mask: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0, rgba(0, 0, 0, 1) 90%, rgba(0, 0, 0, 0) 95%, rgba(0, 0, 0, 0) 0) 100% 90% / 100% 100% repeat-x;-webkit-mask: var(--mask);mask: var(--mask);">
1214
<f:if condition="{records}">

0 commit comments

Comments
 (0)