Come includere backend layout su TS file

Il backend layout permette di personalizzare la vista delle pagine nel BE di TYPO3. Inoltre possiamo collegare ad esso il template in FE. In questo modo l'utente, lavorando in backend, sa l'esatta collocazione del testo nella struttura della pagina.

I backend layout sono creati tramite TSConfig.

Gli step sono i seguenti:

1) Creare i backend layouts su file esterno ( es: BackendLayouts.ts) indicando con 0, ad esempio, il template di default, ecc:

mod.web_layout.BackendLayouts { 
0 {
title = Content
icon = EXT:example_extension/Resources/Public/Images/BackendLayouts/default.gif
config {
backend_layout {
colCount = 1
rowCount = 1
rows {
1 {
columns {
1 {
name = CONTENUTO DELLA PAGINA
colPos = 0
}
}
}
}
}
}
}

2) Nelle proprietà della root page inserire (all'interno del tab "Resources") la seguente riga di codice all'interno del TSConfig:

<INCLUDE_TYPOSCRIPT: source="FILE:{path_del_file}/BackendLayout.ts">

3) All'interno del setup in typoscript inserire:

page.10.file.stdWrap.cObject = CASE
page.10.file.stdWrap.cObject {
key.data = levelfield:-1, backend_layout_next_level, slide
key.override.field = backend_layout
default = TEXT
default.value = {$partials}/Content.html
pagets__0 = TEXT
pagets__0.value = {$partials}/Content.html
pagets__1 = TEXT
pagets__1.value = {$partials}/OtherPage.html
}

Con "pagets_0" andremo ad indicare il template corrispondente al backend layout.