From d9f0cb9a659eab5ccf4613ad40169e05cc9a2012 Mon Sep 17 00:00:00 2001
From: Frank Naegler <frank.naegler@typo3.org>
Date: Wed, 11 Sep 2024 18:46:58 +0200
Subject: [PATCH] [TASK] Add message to Site Settings Overview

If no configurable Site exists, show a message to the user
that explains why nothing exists.

Resolves: #104913
Releases: main
Change-Id: I6e1c39a19d79c82a1552b3d35610b89d6f1b7ba1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86021
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: Benjamin Franzke <ben@bnf.dev>
---
 .../Private/Language/locallang_sitesettings.xlf        | 10 ++++++++--
 .../Private/Templates/SiteSettings/Overview.html       |  8 ++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/backend/Resources/Private/Language/locallang_sitesettings.xlf b/typo3/sysext/backend/Resources/Private/Language/locallang_sitesettings.xlf
index 9263bf44ae51..db6f6647663f 100644
--- a/typo3/sysext/backend/Resources/Private/Language/locallang_sitesettings.xlf
+++ b/typo3/sysext/backend/Resources/Private/Language/locallang_sitesettings.xlf
@@ -16,7 +16,13 @@
 				<source>Edit Settings</source>
 			</trans-unit>
 			<trans-unit id="overview.message.notEditable" resname="overview.message.notEditable">
-				<source>This sets of this sites do not provide any configurable settings.</source>
+				<source>The sets of this sites do not provide any configurable settings.</source>
+			</trans-unit>
+			<trans-unit id="overview.noSiteSettingsExists.title" resname="overview.noSiteSettingsExists.title">
+				<source>No configurable Site Settings found</source>
+			</trans-unit>
+			<trans-unit id="overview.noSiteSettingsExists.message" resname="overview.noSiteSettingsExists.message">
+				<source>See the documentation for instructions on defining settings via site sets.</source>
 			</trans-unit>
 			<trans-unit id="edit.title" resname="edit.noSettings.title">
 				<source>Site Settings for "{siteTitle}"</source>
@@ -25,7 +31,7 @@
 				<source>No Settings available</source>
 			</trans-unit>
 			<trans-unit id="edit.noSettings.message" resname="edit.noSettings.message">
-				<source>The site '%s' does provide configurable settings.</source>
+				<source>The site '%s' does not provide configurable settings.</source>
 			</trans-unit>
 			<trans-unit id="edit.yamlExport" resname="edit.yamlExport">
 				<source>YAML export</source>
diff --git a/typo3/sysext/backend/Resources/Private/Templates/SiteSettings/Overview.html b/typo3/sysext/backend/Resources/Private/Templates/SiteSettings/Overview.html
index 6e468b2884cd..50913feec5fd 100644
--- a/typo3/sysext/backend/Resources/Private/Templates/SiteSettings/Overview.html
+++ b/typo3/sysext/backend/Resources/Private/Templates/SiteSettings/Overview.html
@@ -4,6 +4,14 @@
 
     <h1><f:translate key="LLL:EXT:backend/Resources/Private/Language/locallang_sitesettings.xlf:overview.title"/></h1>
 
+    <f:if condition="{sites->f:count} == 0">
+        <f:be.infobox
+            title="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_sitesettings.xlf:overview.noSiteSettingsExists.title')}"
+            message="{f:translate(key:'LLL:EXT:backend/Resources/Private/Language/locallang_sitesettings.xlf:overview.noSiteSettingsExists.message')}"
+            state="{f:constant(name: 'TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::STATE_INFO')}"
+        />
+    </f:if>
+
     <div class="card-container">
         <f:for each="{sites}" as="c">
             <div class="card card-size-small">
-- 
GitLab