I normally store the Backend-Layouts in folders to structure the extension.
- BackendLayouts/ in which all Backend-Layouts are saved
- BackendLayouts.ts this is where the Layouts are brought together (
<INCLUDE_TYPOSCRIPT: source="Path/To/Backendlayout">
)
Image: Screenshot of the Structure of the Example
Layout-Setup
The basic Setup for a BE-Layout looks like this:
mod.web_layout.BackendLayouts{
exampleKey {
title = Example
config{
# Here you paste the generated BE-Layout
}
}
}
For example (Default.ts):
mod.web_layout.BackendLayouts{
default{
title = Default
config{
backend_layout {
colCount = 2
rowCount = 2
rows {
1 {
columns {
1 {
name = Slider
colspan = 2
colPos = 1
}
}
}
2 {
columns {
1 {
name = Sidebar
colPos = 2
}
2 {
name = Content
colPos = 0
}
}
}
}
}
}
}
}
At last you need to register your Page configuration:
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'test_ext',
'Configuration/TypoScript/Backend/BackendLayouts.ts',
'My special Backend Layouts'
);
?>
This only works for Typo3 v7.4.x and higher
Typo3 Backend
- Clear cache and reload Backend
- Go to the root-Page and edit it
- Go to the "Resource" Tab and add your TypoScript Configuration
- Save, Reload Page
Now you should be able to see your added Backend Layouts when you edit a page.
Further Actions
If you want to use differnt Templates for every BE-Layout, you can simply do this via the "templateName" porperty in your FLUIDTEMPLATE setup as you can see here: Official TypoScript reference, #templateName