[FEATURE] Allow definition of template paths in backend module 79/51079/2
authorSusanne Moog <susanne.moog@typo3.com>
Sat, 31 Dec 2016 09:59:38 +0000 (10:59 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 3 Jan 2017 09:49:38 +0000 (10:49 +0100)
BackendTemplateView now allows overwriting of template paths to add your own
locations for templates, partials and layouts in a BackendTemplateView based
backend module.

Change-Id: I2d8c4b432ff23a3e9b8b527af4697f31082f64b7
Releases: master
Resolves: #79124
Reviewed-on: https://review.typo3.org/51079
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Mona Muzaffar
Reviewed-by: Mona Muzaffar
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/View/BackendTemplateView.php
typo3/sysext/core/Documentation/Changelog/master/Feature-79124-AllowOverwritingOfTemplatePathsInBackendTemplateView.rst [new file with mode: 0644]

index 329f7e1..17c42a4 100644 (file)
@@ -137,4 +137,40 @@ class BackendTemplateView implements ViewInterface
     {
         $this->templateView->initializeView();
     }
+
+    /**
+     * Set the root path(s) to the templates.
+     *
+     * @param array $templateRootPaths Root path(s) to the templates.
+     * @return void
+     * @api
+     */
+    public function setTemplateRootPaths(array $templateRootPaths)
+    {
+        $this->templateView->setTemplateRootPaths($templateRootPaths);
+    }
+
+    /**
+     * Set the root path(s) to the partials.
+     *
+     * @param array $partialRootPaths Root paths to the partials.
+     * @return void
+     * @api
+     */
+    public function setPartialRootPaths(array $partialRootPaths)
+    {
+        $this->templateView->setPartialRootPaths($partialRootPaths);
+    }
+
+    /**
+     * Set the root path(s) to the layouts.
+     *
+     * @param array $layoutRootPaths Root path to the layouts.
+     * @return void
+     * @api
+     */
+    public function setLayoutRootPaths(array $layoutRootPaths)
+    {
+        $this->templateView->setLayoutRootPaths($layoutRootPaths);
+    }
 }
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-79124-AllowOverwritingOfTemplatePathsInBackendTemplateView.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-79124-AllowOverwritingOfTemplatePathsInBackendTemplateView.rst
new file mode 100644 (file)
index 0000000..59d4101
--- /dev/null
@@ -0,0 +1,33 @@
+.. include:: ../../Includes.txt
+
+============================================================================
+Feature: #79124 - Allow overwriting of template paths in BackendTemplateView
+============================================================================
+
+See :issue:`79124`
+
+Description
+===========
+
+BackendTemplateView now allows overwriting of template paths to add your own locations for templates, partials and layouts in a BackendTemplateView based backend module.
+
+Impact
+======
+
+You can now do for example
+
+.. code-block:: php
+
+       $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
+       $viewConfiguration = [
+          'view' => [
+              'templateRootPaths' => ['EXT:myext/Resources/Private/Backend/Templates'],
+              'partialRootPaths' => ['EXT:myext/Resources/Private/Backend/Partials'],
+              'layoutRootPaths' => ['EXT:myext/Resources/Private/Backend/Layouts'],
+          ],
+       ];
+       $this->configurationManager->setConfiguration(array_merge($frameworkConfiguration, $viewConfiguration));
+
+
+
+.. index:: Backend, PHP-API