(no commit message)
authorChristian Weiske <cweiske@cweiske.de>
Mon, 4 Sep 2017 08:38:00 +0000 (10:38 +0200)
committerwww-cweiske <www-cweiske@localhost.localdomain>
Mon, 4 Sep 2017 08:38:00 +0000 (10:38 +0200)
Classes/Typo3/HideContentHeader.php [new file with mode: 0644]
ext_localconf.php [new file with mode: 0644]

diff --git a/Classes/Typo3/HideContentHeader.php b/Classes/Typo3/HideContentHeader.php
new file mode 100644 (file)
index 0000000..15eb47d
--- /dev/null
@@ -0,0 +1,35 @@
+<?php\r
+namespace Example\Together\Typo3;\r
+\r
+use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface;\r
+\r
+/**\r
+ * Modify the content preview rendering in the backend.\r
+ * Remove the content element header and header_layout rendering.\r
+ *\r
+ * @author Christian Weiske <weiske@mogic.com>\r
+ */\r
+class HideContentHeader implements PageLayoutViewDrawItemHookInterface\r
+{\r
+    /**\r
+     * Remove "header" and "header_layout" in the backend content preview.\r
+     *\r
+     * @param object $parentObject  Calling parent object\r
+     * @param bool   $drawItem      Whether to draw the item using the\r
+     *                              default functionalities\r
+     * @param string $headerContent Header content\r
+     * @param string $itemContent   Item content\r
+     * @param array  $row           Record row of tt_content\r
+     *\r
+     * @return void\r
+     */\r
+    public function preProcess(\r
+        \TYPO3\CMS\Backend\View\PageLayoutView &$parentObject,\r
+        &$drawItem, &$headerContent, &$itemContent, array &$row\r
+    ) {\r
+        if ($row['CType'] == 'fluidcontent_content') {\r
+            $headerContent = '';\r
+        }\r
+    }\r
+}\r
+?>\r
diff --git a/ext_localconf.php b/ext_localconf.php
new file mode 100644 (file)
index 0000000..276c7d3
--- /dev/null
@@ -0,0 +1,4 @@
+<?php\r
+#hide content header in backend preview\r
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/class.tx_cms_layout.php']['tt_content_drawItem']['together']\r
+    = 'Mogic\\Together\\Typo3\\HideContentHeader';\r