[BUGFIX] Make styles.content.get available after major FSC rewrite 84/51884/7
authorJosef Glatz <josefglatz@gmail.com>
Tue, 28 Feb 2017 06:36:35 +0000 (07:36 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 9 Mar 2017 07:47:35 +0000 (08:47 +0100)
Since the major rewrite of EXT:fluid_styled_content and
EXT:css_styled_content the following TypoScript setup must
be loaded by default:

* `styles.content.get` can be used as ready2use `CONTENT`
  object for `colPos = 0`
* `tt_content.default` outputs necessary info in the frontend,
  if the CType has currently no rendering definition

Both can be used independently from FSC or CSC.

Including the necessary TypoScript via `addTypoScriptSetup()`
takes care of loading it before any other activated extension.

Resolves: #80044
Related: #79622
Releases: master
Change-Id: I460ed9f57e215be96ee13d6714cd522882fb53eb
Reviewed-on: https://review.typo3.org/51884
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Tested-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Tested-by: Daniela Grammlich <grammlich@punkt.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/frontend/ext_localconf.php
typo3/sysext/frontend/ext_typoscript_setup.txt [deleted file]

index bc98247..1a45b0a 100644 (file)
@@ -45,6 +45,36 @@ $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_cms_showpic'] = \TYPO3\CMS\
        options.disableDelete.sys_file = 1
 ');
 
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup(
+    '
+# Content selection
+styles.content.get = CONTENT
+styles.content.get {
+    table = tt_content
+    select {
+        orderBy = sorting
+        where = colPos=0
+    }
+}
+
+
+# Content element rendering
+tt_content = CASE
+tt_content {
+    key {
+        field = CType
+    }
+    default = TEXT
+    default {
+        field = CType
+        htmlSpecialChars = 1
+        wrap = <p style="background-color: yellow; padding: 0.5em 1em;"><strong>ERROR:</strong> Content Element with uid "{field:uid}" and type "|" has no rendering definition!</p>
+        wrap.insertData = 1
+    }
+}
+    '
+);
+
 // Registering hooks for the tree list cache
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass'][] = \TYPO3\CMS\Frontend\Hooks\TreelistCacheUpdateHooks::class;
diff --git a/typo3/sysext/frontend/ext_typoscript_setup.txt b/typo3/sysext/frontend/ext_typoscript_setup.txt
deleted file mode 100644 (file)
index 1bd4c87..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# Content selection
-styles.content.get = CONTENT
-styles.content.get {
-    table = tt_content
-    select {
-        orderBy = sorting
-        where = colPos=0
-    }
-}
-
-
-# Content element rendering
-tt_content = CASE
-tt_content {
-    key {
-        field = CType
-    }
-    default = TEXT
-    default {
-        field = CType
-        htmlSpecialChars = 1
-        wrap = <p style="background-color: yellow; padding: 0.5em 1em;"><strong>ERROR:</strong> Content Element with uid "{field:uid}" and type "|" has no rendering definition!</p>
-        wrap.insertData = 1
-    }
-}