diff --git a/Classes/Event/Listener/AfterTcaCompilationEventListener.php b/Classes/Event/Listener/AfterTcaCompilationEventListener.php
new file mode 100644
index 0000000..9c54941
--- /dev/null
+++ b/Classes/Event/Listener/AfterTcaCompilationEventListener.php
@@ -0,0 +1,26 @@
+setTca($GLOBALS['TCA']);
+ }
+}
diff --git a/Classes/Utility/TcaUtility.php b/Classes/Utility/TcaUtility.php
index 232fc7e..0816667 100644
--- a/Classes/Utility/TcaUtility.php
+++ b/Classes/Utility/TcaUtility.php
@@ -91,6 +91,18 @@ public static function addPageConfigFlexForm(array|string $dataStructure): void
$GLOBALS['TCA']['pages']['columns']['tx_headless_config']['config']['ds']['default'] = $newFlexFormString;
}
+ /**
+ * @param mixed[]|string $dataStructure either a xml flexform file path, a xml flexform string or a flexform array
+ */
+ public static function setFooterFlexForm(array|string $dataStructure): void
+ {
+ $newFlexFormArray = self::getFlexFormArray($dataStructure);
+ $flexFormTools = GeneralUtility::makeInstance(FlexFormTools::class);
+ $newFlexFormString = $flexFormTools->flexArray2Xml($newFlexFormArray, true);
+
+ $GLOBALS['TCA']['pages']['columns']['tx_headless_footer']['config']['ds']['default'] = $newFlexFormString;
+ }
+
/**
* @param mixed[]|string $dataStructure either a xml flexform file path, a xml flexform string or a flexform array
* @return mixed[]
diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml
index 40ad936..148249d 100644
--- a/Configuration/Services.yaml
+++ b/Configuration/Services.yaml
@@ -19,3 +19,7 @@ services:
tags:
-
name: event.listener
+ Remind\Headless\Event\Listener\AfterTcaCompilationEventListener:
+ tags:
+ -
+ name: event.listener
\ No newline at end of file
diff --git a/Configuration/TCA/Overrides/pages.php b/Configuration/TCA/Overrides/pages.php
index d085bb0..4f168d2 100644
--- a/Configuration/TCA/Overrides/pages.php
+++ b/Configuration/TCA/Overrides/pages.php
@@ -37,6 +37,19 @@
'displayCond' => 'FIELD:is_siteroot:REQ:true',
'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_pages.xlf:page_config',
],
+ 'tx_headless_footer' => [
+ 'config' => [
+ 'behaviour' => [
+ 'allowLanguageSynchronization' => true,
+ ],
+ 'ds' => [
+ 'default' => 'FILE:EXT:rmnd_headless/Configuration/FlexForms/Empty.xml',
+ ],
+ 'type' => 'flex',
+ ],
+ 'displayCond' => 'FIELD:is_siteroot:REQ:true',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_pages.xlf:footer',
+ ],
'tx_headless_overview_label' => [
'config' => [
'type' => 'input',
@@ -61,5 +74,14 @@
ExtensionManagementUtility::addToAllTCAtypes(
'pages',
- 'tx_headless_config',
+ '--div--;LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_pages.xlf:page_config,tx_headless_config',
+ '',
+ 'after:rowDescription'
+);
+
+ExtensionManagementUtility::addToAllTCAtypes(
+ 'pages',
+ '--div--;LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_pages.xlf:footer,tx_headless_footer',
+ '',
+ 'after:rowDescription'
);
diff --git a/Configuration/TCA/Overrides/tt_content.php b/Configuration/TCA/Overrides/tt_content.php
index c9777b6..2cfebda 100644
--- a/Configuration/TCA/Overrides/tt_content.php
+++ b/Configuration/TCA/Overrides/tt_content.php
@@ -46,23 +46,23 @@
'default' => null,
'items' => [
[
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.category.none',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.category.none',
'value' => null,
],
[
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.category.necessary',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.category.necessary',
'value' => 0,
],
[
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.category.preferences',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.category.preferences',
'value' => 1,
],
[
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.category.statistics',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.category.statistics',
'value' => 2,
],
[
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.category.marketing',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.category.marketing',
'value' => 3,
],
],
@@ -70,7 +70,7 @@
'type' => 'select',
],
'exclude' => 0,
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.category',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.category',
],
'tx_headless_cookie_message' => [
'config' => [
@@ -81,7 +81,7 @@
'type' => 'text',
],
'l10n_mode' => 'prefixLangTitle',
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookie.message',
+ 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:cookies.message',
],
'tx_headless_item' => [
'config' => [
@@ -189,8 +189,15 @@
'after:space_after_class'
);
-ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'tx_headless_cookie_category');
-ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'tx_headless_cookie_message');
+/**
+ * Palette will be added in AfterTcaCompilationEventListener so Content Elements
+ * added in Extensions after this one will also have the palette
+ */
+ExtensionManagementUtility::addFieldsToPalette(
+ 'tt_content',
+ 'cookies',
+ 'tx_headless_cookie_category,--linebreak--,tx_headless_cookie_message',
+);
$GLOBALS['TCA']['tt_content']['ctrl']['previewRenderer'] = ContentWithItemsPreviewRenderer::class;
@@ -230,5 +237,5 @@
];
// Workaround for TCEFORM (https://forge.typo3.org/issues/100775)
- $GLOBALS['TCA']['tt_content']['columns']['space_after_class']['config']['items'][0]['label'] = 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:space_none';
- $GLOBALS['TCA']['tt_content']['columns']['space_before_class']['config']['items'][0]['label'] = 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:space_none';
+$GLOBALS['TCA']['tt_content']['columns']['space_after_class']['config']['items'][0]['label'] = 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:space_none';
+$GLOBALS['TCA']['tt_content']['columns']['space_before_class']['config']['items'][0]['label'] = 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:space_none';
diff --git a/Configuration/TCA/Overrides/tt_content_footer_content.php b/Configuration/TCA/Overrides/tt_content_footer_content.php
deleted file mode 100644
index f14eca1..0000000
--- a/Configuration/TCA/Overrides/tt_content_footer_content.php
+++ /dev/null
@@ -1,37 +0,0 @@
- 'default',
- 'icon' => 'content-footer',
- 'label' => 'LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ce.xlf:footer_content.title',
- 'value' => 'footer_content',
- ],
-);
-
-$GLOBALS['TCA']['tt_content']['types']['footer_content'] = [
- 'showitem' => '
- --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
- --palette--;;general,
- header,
- pi_flexform,
- --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
- --palette--;;language,
- --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
- --palette--;;hidden,
- --palette--;;access,
- --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
- categories,
- --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
- rowDescription,
- --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
- ',
-];
diff --git a/Configuration/TSConfig/Page/BackendLayouts/default.tsconfig b/Configuration/TSConfig/Page/BackendLayouts/default.tsconfig
index 65c19a0..e0249f3 100644
--- a/Configuration/TSConfig/Page/BackendLayouts/default.tsconfig
+++ b/Configuration/TSConfig/Page/BackendLayouts/default.tsconfig
@@ -13,9 +13,6 @@ mod {
1 {
name = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_bl.xlf:column.above_breadcrumbs
colPos = 1687238554
- disallowed {
- CType = footer_content
- }
}
}
}
@@ -24,9 +21,6 @@ mod {
1 {
name = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_bl.xlf:column.main
colPos = 0
- disallowed {
- CType = footer_content
- }
}
}
}
diff --git a/Configuration/TSConfig/Page/BackendLayouts/root.tsconfig b/Configuration/TSConfig/Page/BackendLayouts/root.tsconfig
index 8e2c726..b895df4 100644
--- a/Configuration/TSConfig/Page/BackendLayouts/root.tsconfig
+++ b/Configuration/TSConfig/Page/BackendLayouts/root.tsconfig
@@ -6,28 +6,13 @@ mod {
config {
backend_layout {
colCount = 1
- rowCount = 2
+ rowCount = 1
rows {
1 {
columns {
1 {
name = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_bl.xlf:column.main
colPos = 0
- disallowed {
- CType = footer_content
- }
- }
- }
- }
- 2 {
- columns {
- 1 {
- name = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_bl.xlf:column.footer
- colPos = 1687238527
- allowed {
- CType = footer_content
- }
- maxitems = 1
}
}
}
diff --git a/Configuration/TSConfig/Page/TCEFORM.tsconfig b/Configuration/TSConfig/Page/TCEFORM.tsconfig
index 9a320ae..f1a4f87 100644
--- a/Configuration/TSConfig/Page/TCEFORM.tsconfig
+++ b/Configuration/TSConfig/Page/TCEFORM.tsconfig
@@ -18,9 +18,6 @@ TCEFORM {
altLabels.image = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ce.xlf:image.title
}
frame_class.disabled = 1
- header.types {
- footer_content.label = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ttc.xlf:header.label.backendOnly
- }
image.types {
image.config.maxitems = 1
image.config.minitems = 1
diff --git a/Configuration/TSConfig/Page/WizardItems.tsconfig b/Configuration/TSConfig/Page/WizardItems.tsconfig
index 0a620c0..f5daaf1 100644
--- a/Configuration/TSConfig/Page/WizardItems.tsconfig
+++ b/Configuration/TSConfig/Page/WizardItems.tsconfig
@@ -9,14 +9,6 @@ mod.wizards.newContentElement.wizardItems {
CType = accordion
}
}
- footer_content {
- iconIdentifier = content-footer
- title = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ce.xlf:footer_content.title
- description = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ce.xlf:footer_content.description
- tt_content_defValues {
- CType = footer_content
- }
- },
// Element already exsists, only modify title and description
image {
title = LLL:EXT:rmnd_headless/Resources/Private/Language/locallang_ce.xlf:image.title
@@ -40,7 +32,6 @@ mod.wizards.newContentElement.wizardItems {
}
}
show := addToList(accordion)
- show := addToList(footer_content)
show := addToList(image_gallery)
show := addToList(tabs)
}
diff --git a/Configuration/TypoScript/Configuration/InitialDataConfiguration.typoscript b/Configuration/TypoScript/Configuration/InitialDataConfiguration.typoscript
index 9cca5c0..66e4a8c 100644
--- a/Configuration/TypoScript/Configuration/InitialDataConfiguration.typoscript
+++ b/Configuration/TypoScript/Configuration/InitialDataConfiguration.typoscript
@@ -16,15 +16,15 @@ initialData {
}
}
}
- footer = CONTENT
+ footer = JSON
footer {
- table = tt_content
- select {
- orderBy = sorting
- where = {#colPos} = 1687238527
- max = 1
+ dataProcessing {
+ 10 = Remind\Headless\DataProcessing\FlexFormProcessor
+ 10 {
+ fieldName = tx_headless_footer
+ as = flexform
+ }
}
- slide = -1
}
}
}
diff --git a/Configuration/TypoScript/ContentElement/FooterContent.typoscript b/Configuration/TypoScript/ContentElement/FooterContent.typoscript
deleted file mode 100644
index ec99ef8..0000000
--- a/Configuration/TypoScript/ContentElement/FooterContent.typoscript
+++ /dev/null
@@ -1,10 +0,0 @@
-tt_content.footer_content = JSON
-tt_content.footer_content {
- dataProcessing {
- 10 = Remind\Headless\DataProcessing\FlexFormProcessor
- 10 {
- fieldName = pi_flexform
- as = flexform
- }
- }
-}
diff --git a/README.md b/README.md
index 782f785..0c1ec65 100644
--- a/README.md
+++ b/README.md
@@ -29,11 +29,7 @@ Required dependencies are [headless](https://github.com/TYPO3-Headless/headless)
### Default
-The default layout consists of 1 column with 3 rows. Besides the main content (colPos = 0) there is also one column for content above the breadcrumbs (colPos = 1) and the footer (colPos = 10).
-
-The [content defender](https://extensions.typo3.org/extension/content_defender) extension is used to only allow exactly one footer_content content element in the footer column. The footer_content content element can not be used in the other columns.
-
-
+The default layout consists of 1 column with 2 rows. Besides the main content (colPos = 0) there is also one column for content above the breadcrumbs (colPos = 1).
## TCA
@@ -126,6 +122,14 @@ Similar to `space_before_inside`.
### pages
+#### tx_headless_footer
+
+The `tx_headless_footer` flexform field contains the footer content. Use the following code to set a flexform:
+
+```php
+\Remind\Headless\Utility::setFooterFlexForm('FILE:EXT:provider_extension/Configuration/FlexForms/Footer.xml');
+```
+
#### tx_headless_overview_label
An `tx_headless_overview_label` field is added to the page TCA. The field should be used to customize the label for the overview pages.
@@ -177,18 +181,6 @@ $GLOBALS['TCA']['tt_content']['types']['accordion']['columnsOverrides']['tx_head
Uses `tx_headless_item`, items consist of text (header, subheader, bodytext, title), a flexform field and images.
-### footer_content
-
-Basic definition without any actual content fields. Add a flexform in your provider extension to use `footer_content`:
-
-```php
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
- '*',
- 'FILE:EXT:provider_extension/Configuration/FlexForms/FooterContent.xml',
- 'footer_content'
-);
-```
-
### tabs
Uses `tx_headless_item`, items consist of text (header, subheader, bodytext) only.
diff --git a/Resources/Private/Language/de.locallang_bl.xlf b/Resources/Private/Language/de.locallang_bl.xlf
index f902e64..bf17b80 100644
--- a/Resources/Private/Language/de.locallang_bl.xlf
+++ b/Resources/Private/Language/de.locallang_bl.xlf
@@ -9,9 +9,6 @@
Über Breadcrumbs
-
- Fußzeile
-
Standard
diff --git a/Resources/Private/Language/de.locallang_ce.xlf b/Resources/Private/Language/de.locallang_ce.xlf
index 00e1184..ca81028 100644
--- a/Resources/Private/Language/de.locallang_ce.xlf
+++ b/Resources/Private/Language/de.locallang_ce.xlf
@@ -12,12 +12,6 @@
Akkordion Titel
-
-
Einzelnes Bild
diff --git a/Resources/Private/Language/de.locallang_pages.xlf b/Resources/Private/Language/de.locallang_pages.xlf
index cdde7ef..de5f5e4 100644
--- a/Resources/Private/Language/de.locallang_pages.xlf
+++ b/Resources/Private/Language/de.locallang_pages.xlf
@@ -9,6 +9,9 @@
Keine
+
Page Config
diff --git a/Resources/Private/Language/de.locallang_ttc.xlf b/Resources/Private/Language/de.locallang_ttc.xlf
index 3b9af48..c8c7fab 100644
--- a/Resources/Private/Language/de.locallang_ttc.xlf
+++ b/Resources/Private/Language/de.locallang_ttc.xlf
@@ -12,25 +12,28 @@
Hintergrund über gesamte Breite
-
+
+ Cookies
+
+
Cookie Kategorie
-
+
Keine
-
+
Notwendig
-
+
Präferenzen
-
+
Statistiken
-
+
Marketing
-
+
Cookie Meldung