0
votes

I'm trying to add my own page template with bootstrap_package called "Default, White Sheet". It is a copy of "Default", but with an extra CSS class added in the content element.

My custom template does not show up in Page Properties > Appearance > Backend Layout.

So far, I have:


1. Changed template folder

Copied the "bootstrap_package/Resources" folder to "fileadmin/bootstrap_package/Resources" and edited root template constants to point to the new location:

page.fluidtemplate.templateRootPath = fileadmin/bootstrap_package/Resources/Private/Templates/Page/

I have verified this by slightly editing one of the existing templates and seeing a change.


2. Created custom template HTML

Added DefaultWhiteSheet.html under fileadmin/bootstrap_package/Resources/Private/Templates/Page/

As stated, my custom template is an exact copy of Default.html, only with an extra css class added to the container element.


3. Added TS definition in setup

In root template setup I added:

<INCLUDE_TYPOSCRIPT: source="FILE:fileadmin/typoscript/layout_default_white_sheet.txt">
page.10.templateName.stdWrap.cObject.pagets__default_white_sheet = TEXT
page.10.templateName.stdWrap.cObject.pagets__default_white_sheet.value = DefaultWhiteSheet

layout_default_white_sheet.txt contains the TS definition of

mod.web_layout.BackendLayouts.default_white_sheet {
    title = Default White Sheet
    config {
        backend_layout {
            colCount = 6
            rowCount = 3
        etc etc

It is copy of /typo3conf/ext/bootstrap_package/Configuration/PageTS/Mod/WebLayout/BackendLayouts/default.txt only with the names changed.


Still, my custom template does not show up in page properties where you choose a page layout.

2
I'm not sure but I see might be problem with template folder which you changed, have a look here docs.typo3.org/typo3cms/extensions/bootstrap_package/… - Ghanshyam Gohel
That's the old version, this is the new version: docs.typo3.org/typo3cms/extensions/bootstrap_package/… Thanks anyways - johndoe33

2 Answers

0
votes

Suddenly it works. I'm not sure what happened. I leave this question as a "walkthrough" for later.

0
votes

The way you did this can not work, because you mixed up TypoScript with TSConfig. The Backend Layouts available for the field "Backend Layouts" in the "Appearance" tab have to be configured in TSConfig. You included the Backend Layout file in TypoScript, which is used for frontend rendering and not backend configuration. Have a look at my answer here TYPO3 8.7.0 does not include TypoScript