[TASK] Split fluid styled content rendering definitions 55/51055/4
authorBenjamin Kott <benjamin.kott@wfp2.com>
Wed, 28 Dec 2016 23:36:11 +0000 (00:36 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 29 Dec 2016 14:56:15 +0000 (15:56 +0100)
Moving the rendering definitions for content elements to dedicated
files provides a better overview over the configuration and creates
a single responsibility per configuration file.

Resolves: #79102
Releases: master

Change-Id: Iecdecaf224c3db2f8d4f319963e09f7ea0dab45b
Reviewed-on: https://review.typo3.org/51055
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Tobias Wollender <tliegl@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
12 files changed:
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Bullets.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Default.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Div.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Header.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Html.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/List.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Menu.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Shortcut.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Table.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Textmedia.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Configuration/TypoScript/Static/setup.txt

diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Bullets.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Bullets.txt
new file mode 100644 (file)
index 0000000..db0f341
--- /dev/null
@@ -0,0 +1,38 @@
+# Bullet List:
+# A single bullet list.
+#
+# CType: bullets
+
+tt_content.bullets =< lib.fluidContent
+tt_content.bullets {
+    templateName = Bullets
+    dataProcessing {
+        10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor
+        10 {
+            if {
+                value = 2
+                isLessThan.field = bullets_type
+            }
+            fieldName = bodytext
+            removeEmptyEntries = 1
+            as = bullets
+        }
+        20 = TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor
+        20 {
+            fieldName = bodytext
+            if {
+                value = 2
+                equals.field = bullets_type
+            }
+            fieldDelimiter = |
+            as = bullets
+        }
+    }
+    stdWrap {
+        editIcons = tt_content: header [header_layout], bodytext [bullets_type]
+        editIcons {
+            beforeLastTag = 1
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.bullets
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Default.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Default.txt
new file mode 100644 (file)
index 0000000..b23a57f
--- /dev/null
@@ -0,0 +1,7 @@
+# Default:
+# The "default" content element, which will be called when no rendering definition can be found
+
+tt_content.default =< lib.fluidContent
+tt_content.default {
+    templateName = Default
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Div.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Div.txt
new file mode 100644 (file)
index 0000000..17cd134
--- /dev/null
@@ -0,0 +1,9 @@
+# Divider:
+# This element inserts a visual divider, which is by default a horizontal line.
+#
+# CType: div
+
+tt_content.div =< lib.fluidContent
+tt_content.div {
+    templateName = Div
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Header.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Header.txt
new file mode 100644 (file)
index 0000000..d4fd0e4
--- /dev/null
@@ -0,0 +1,16 @@
+# Header Only:
+# Adds a header only.
+#
+# CType: header
+
+tt_content.header =< lib.fluidContent
+tt_content.header {
+    templateName = Header
+    stdWrap {
+        editIcons = tt_content: header [header_layout|header_link], subheader, date
+        editIcons {
+            beforeLastTag = 1
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.header
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Html.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Html.txt
new file mode 100644 (file)
index 0000000..944faf7
--- /dev/null
@@ -0,0 +1,16 @@
+# Plain HTML:
+# With this element you can output raw HTML code on the page.
+#
+# CType: html
+
+tt_content.html =< lib.fluidContent
+tt_content.html {
+    templateName = Html
+    stdWrap {
+        editIcons = tt_content: bodytext
+        editIcons {
+            beforeLastTag = 1
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.html
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/List.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/List.txt
new file mode 100644 (file)
index 0000000..cb0b749
--- /dev/null
@@ -0,0 +1,15 @@
+# General Plugin:
+# This is the default rendering definition for plugins.
+#
+# CType: list
+
+tt_content.list =< lib.fluidContent
+tt_content.list {
+    templateName = List
+    stdWrap {
+        editIcons = tt_content: header [header_layout], list_type, layout, select_key, pages [recursive]
+        editIcons {
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.list
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Menu.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Menu.txt
new file mode 100644 (file)
index 0000000..b943410
--- /dev/null
@@ -0,0 +1,33 @@
+# Special Menus:
+# Creates a menu of pages, sitemap or other special menus.
+#
+# CType: menu
+
+tt_content.menu =< lib.fluidContent
+tt_content.menu {
+    templateName = Menu
+    dataProcessing {
+        10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor
+        10 {
+            if.isTrue.field = pages
+            fieldName = pages
+            delimiter = ,
+            removeEmptyEntries = 1
+            filterIntegers = 1
+            filterUnique = 1
+            as = pageUids
+        }
+        20 < .10
+        20 {
+            if.isTrue.field = selected_categories
+            fieldName = selected_categories
+            as = categoryUids
+        }
+    }
+    stdWrap {
+        editIcons = tt_content: header [header_layout], menu_type, pages
+        editIcons {
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.menu
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Shortcut.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Shortcut.txt
new file mode 100644 (file)
index 0000000..6a69a17
--- /dev/null
@@ -0,0 +1,23 @@
+# Insert records:
+# This element embeds other content elements.
+#
+# CType: shortcut
+
+tt_content.shortcut =< lib.fluidContent
+tt_content.shortcut {
+    templateName = Shortcut
+
+    # Keep this, since the "conf" option can be used
+    variables.shortcuts = RECORDS
+    variables.shortcuts {
+        source.field = records
+        tables = {$styles.content.shortcut.tables}
+    }
+
+    stdWrap {
+        editIcons = tt_content: header [header_layout], records
+        editIcons {
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.shortcut
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Table.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Table.txt
new file mode 100644 (file)
index 0000000..3b80738
--- /dev/null
@@ -0,0 +1,32 @@
+# Table:
+# A simple table.
+#
+# CType: table
+
+tt_content.table =< lib.fluidContent
+tt_content.table {
+    templateName = Table
+    dataProcessing {
+        10 = TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor
+        10 {
+            fieldName = bodytext
+            fieldDelimiter.char.cObject = TEXT
+            fieldDelimiter.char.cObject {
+                field = table_delimiter
+            }
+            fieldEnclosure.char.cObject = TEXT
+            fieldEnclosure.char.cObject {
+                field = table_enclosure
+            }
+            maximumColumns.field = cols
+            as = table
+        }
+    }
+    stdWrap {
+        editIcons = tt_content: header [header_layout], bodytext, [table_caption|cols|table_header_position|table_tfoot]
+        editIcons {
+            beforeLastTag = 1
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.table
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Textmedia.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Textmedia.txt
new file mode 100644 (file)
index 0000000..c4f32e4
--- /dev/null
@@ -0,0 +1,29 @@
+# Text & Media:
+# Any number of media wrapped right around a regular text element.
+#
+# CType: textmedia
+
+tt_content.textmedia =< lib.fluidContent
+tt_content.textmedia {
+    templateName = Textmedia
+    dataProcessing {
+        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
+        10 {
+            references.fieldName = assets
+        }
+        20 = TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor
+        20 {
+            maxGalleryWidth = {$styles.content.textmedia.maxW}
+            maxGalleryWidthInText = {$styles.content.textmedia.maxWInText}
+            columnSpacing = {$styles.content.textmedia.columnSpacing}
+            borderWidth = {$styles.content.textmedia.borderWidth}
+            borderPadding = {$styles.content.textmedia.borderPadding}
+        }
+    }
+    stdWrap {
+        editIcons = tt_content: header [header_layout], bodytext, assets [imageorient|imagewidth|imageheight], [imagecols|imageborder], image_zoom
+        editIcons {
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.textmedia
+        }
+    }
+}
diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt
new file mode 100644 (file)
index 0000000..018e5de
--- /dev/null
@@ -0,0 +1,23 @@
+# File Links:
+# Makes a list of files for download.
+#
+# CType: uploads
+
+tt_content.uploads =< lib.fluidContent
+tt_content.uploads {
+    templateName = Uploads
+    dataProcessing {
+        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
+        10 {
+            references.fieldName = media
+            collections.field = file_collections
+            sorting.field = filelink_sorting
+        }
+    }
+    stdWrap {
+        editIcons = tt_content: header [header_layout], media, file_collections, filelink_sorting, [filelink_size|uploads_description|uploads_type]
+        editIcons {
+            iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.uploads
+        }
+    }
+}
index 04b478c..aed77fe 100644 (file)
+# Include setup
 <INCLUDE_TYPOSCRIPT: source="FILE:./Setup/lib.parseFunc.ts">
 <INCLUDE_TYPOSCRIPT: source="FILE:./Setup/lib.fluidContent.ts">
 <INCLUDE_TYPOSCRIPT: source="FILE:./Setup/lib.stdheader.ts">
 <INCLUDE_TYPOSCRIPT: source="FILE:./Setup/styles.content.get.ts">
 
+
+# Content element rendering
 tt_content = CASE
 tt_content {
-       key {
-               field = CType
-       }
-       stdWrap {
-               # Setup the edit panel for all content elements
-               editPanel = 1
-               editPanel {
-                       allow = move, new, edit, hide, delete
-                       label = %s
-                       onlyCurrentPid = 1
-                       previewBorder = 1
-                       edit.displayRecord = 1
-               }
-       }
-       bullets =< lib.fluidContent
-       bullets {
-               templateName = Bullets
-               dataProcessing {
-                       10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor
-                       10 {
-                               if {
-                                       value = 2
-                                       isLessThan.field = bullets_type
-                               }
-                               fieldName = bodytext
-                               removeEmptyEntries = 1
-                               as = bullets
-                       }
-                       20 = TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor
-                       20 {
-                               fieldName = bodytext
-                               if {
-                                       value = 2
-                                       equals.field = bullets_type
-                               }
-                               fieldDelimiter = |
-                               as = bullets
-                       }
-               }
-               stdWrap {
-                       # Setup the edit icon for content element "bullets"
-                       editIcons = tt_content: header [header_layout], bodytext [bullets_type]
-                       editIcons {
-                               beforeLastTag = 1
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.bullets
-                       }
-               }
-       }
-       div =< lib.fluidContent
-       div {
-               templateName = Div
-       }
-       header =< lib.fluidContent
-       header {
-               templateName = Header
-               stdWrap {
-                       # Setup the edit icon for content element "header"
-                       editIcons = tt_content: header [header_layout|header_link], subheader, date
-                       editIcons {
-                               beforeLastTag = 1
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.header
-                       }
-               }
-       }
-       html =< lib.fluidContent
-       html {
-               templateName = Html
-               stdWrap {
-                       # Setup the edit icon for content element "html"
-                       editIcons = tt_content: bodytext
-                       editIcons {
-                               beforeLastTag = 1
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.html
-                       }
-               }
-       }
-       list =< lib.fluidContent
-       list {
-               templateName = List
-               stdWrap {
-                       # Setup the edit icon for content element "list"
-                       editIcons = tt_content: header [header_layout], list_type, layout, select_key, pages [recursive]
-                       editIcons {
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.list
-                       }
-               }
-       }
-       menu =< lib.fluidContent
-       menu {
-               templateName = Menu
-               dataProcessing {
-                       10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor
-                       10 {
-                               if.isTrue.field = pages
-                               fieldName = pages
-                               delimiter = ,
-                               removeEmptyEntries = 1
-                               filterIntegers = 1
-                               filterUnique = 1
-                               as = pageUids
-                       }
-                       20 < .10
-                       20 {
-                               if.isTrue.field = selected_categories
-                               fieldName = selected_categories
-                               as = categoryUids
-                       }
-               }
-               stdWrap {
-                       # Setup the edit icon for content element "menu"
-                       editIcons = tt_content: header [header_layout], menu_type, pages
-                       editIcons {
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.menu
-                       }
-               }
-       }
-       shortcut =< lib.fluidContent
-       shortcut {
-               templateName = Shortcut
-
-               # Keep this, since the "conf" option can be used
-               variables.shortcuts = RECORDS
-               variables.shortcuts {
-                       source.field = records
-                       tables = {$styles.content.shortcut.tables}
-               }
-
-               stdWrap {
-                       # Setup the edit icon for content element "shortcut"
-                       editIcons = tt_content: header [header_layout], records
-                       editIcons {
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.shortcut
-                       }
-               }
-       }
-       table =< lib.fluidContent
-       table {
-               templateName = Table
-               dataProcessing {
-                       10 = TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor
-                       10 {
-                               fieldName = bodytext
-                               fieldDelimiter.char.cObject = TEXT
-                               fieldDelimiter.char.cObject {
-                                       field = table_delimiter
-                               }
-                               fieldEnclosure.char.cObject = TEXT
-                               fieldEnclosure.char.cObject {
-                                       field = table_enclosure
-                               }
-                               maximumColumns.field = cols
-                               as = table
-                       }
-               }
-               stdWrap {
-                       # Setup the edit icon for content element "table"
-                       editIcons = tt_content: header [header_layout], bodytext, [table_caption|cols|table_header_position|table_tfoot]
-                       editIcons {
-                               beforeLastTag = 1
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.table
-                       }
-               }
-       }
-       textmedia =< lib.fluidContent
-       textmedia {
-               templateName = Textmedia
-               dataProcessing {
-                       10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
-                       10 {
-                               references.fieldName = assets
-                       }
-                       20 = TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor
-                       20 {
-                               maxGalleryWidth = {$styles.content.textmedia.maxW}
-                               maxGalleryWidthInText = {$styles.content.textmedia.maxWInText}
-                               columnSpacing = {$styles.content.textmedia.columnSpacing}
-                               borderWidth = {$styles.content.textmedia.borderWidth}
-                               borderPadding = {$styles.content.textmedia.borderPadding}
-                       }
-               }
-               stdWrap {
-                       # Setup the edit icon for content element "textmedia"
-                       editIcons = tt_content: header [header_layout], bodytext, assets [imageorient|imagewidth|imageheight], [imagecols|imageborder], image_zoom
-                       editIcons {
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.textmedia
-                       }
-               }
-       }
-       uploads =< lib.fluidContent
-       uploads {
-               templateName = Uploads
-               dataProcessing {
-                       10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
-                       10 {
-                               references.fieldName = media
-                               collections.field = file_collections
-                               sorting.field = filelink_sorting
-                       }
-               }
-               stdWrap {
-                       # Setup the edit icon for content element "uploads"
-                       editIcons = tt_content: header [header_layout], media, file_collections, filelink_sorting, [filelink_size|uploads_description|uploads_type]
-                       editIcons {
-                               iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.uploads
-                       }
-               }
-       }
-
-       # The "default" content element, which will be called when no rendering definition can be found
-       default =< lib.fluidContent
+    key {
+        field = CType
+    }
+    stdWrap {
+        # Setup the edit panel for all content elements
+        editPanel = 1
+        editPanel {
+            allow = move, new, edit, hide, delete
+            label = %s
+            onlyCurrentPid = 1
+            previewBorder = 1
+            edit.displayRecord = 1
+        }
+    }
 }
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Bullets.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Div.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Header.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Html.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/List.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Menu.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Shortcut.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Table.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Textmedia.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt">
+<INCLUDE_TYPOSCRIPT: source="FILE:EXT:fluid_styled_content/Configuration/TypoScript/ContentElement/Default.txt">