Issue Bug Closed

#104365page.tsconfig vs. ExtensionManagementUtility::addPageTSConfig

Christoph Erdmann 07/11/24, 13:06 updated 11/19/26, 13:34

Description

Starting with TYPO3 12 it is possible to add a file page.tsconfig in my_ext/Configuration (see https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/UsingSetting/PageTSconfig.html#pagesettingdefaultpagetsconfig).

To be compatible with TYPO3 11.5, one can add ExtensionManagementUtility::addPageTSConfig() in ext_localconf.php .

I am interpreting the docs in the way, that both ways can be used equally. As I don’t have to be compatible with 11.5 I opted to use page.tsconfig .

BUT:
When using ExtensionManagementUtility::addPageTSConfig() the resulting TSConfig is other than when using page.tsconfig . Namely I want to override the backend layouts provided by the extension bootstrap_package. I am trying to unset all but one layout and change the config of that layout.

When using ExtensionManagementUtility::addPageTSConfig() the unsetting and overriding works as expected, when using page.tsconfig the unsetting and overriding is not working at all but new properties are merged into the config.

Entry file:

[1 in tree.rootLineParentIds]
@import 'EXT:sitepackage/Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts.tsconfig'

# remove unused backend layouts
mod {
    web_layout {
        BackendLayouts {
            2_columns >
            2_columns_25_75 >
            2_columns_50_50 >
            2_columns_offset_right >
            3_columns >
            simple >
            special_feature >
            special_start >
            subnavigation_left >
            subnavigation_left_2_columns >
            subnavigation_right >
            subnavigation_right_2_columns >
        }
    }
}
[END]

Backend layout config: (BackendLayouts.tsconfig)

################################
#### BACKENDLAYOUT: DEFAULT ####
################################
mod {
    SHARED.colPos_list = ...
    web_layout {
        BackendLayouts {
            default {
                title = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.default
                config {
                    backend_layout {
                        rowCount = 6
                        rows {
                            ...
                            3 {
                                columns {
                                    1 {
                                        name = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.column.normal
                                        colPos = 0
                                        colspan = 12
                                    }
                                }
                            }
                            ...
                            6 {
                                columns {
                                    1 {
                                        name = LLL:EXT:sitepackage/Resources/Private/Language/backend.xlf:backend_layout.column.footerafter
                                        colPos = 13
                                        colspan = 12
                                    }
                                }
                            }
                        }
                    }
                }
                icon = EXT:bootstrap_package/Resources/Public/Icons/BackendLayouts/default.svg
            }
        }
    }
}

Result with page.tsconfig

  • backend layouts are NOT removed (e. g. 2_columns >)
  • mod.SHARED.colPos_list is added
  • rows.6 is added
  • config.backend_layout.rowCount is ‘5’ in bootstrap_package, but gets NOT overridden with ‘6’ as intended
  • changed name of 3.columns.1.name for testing, but is not overriden either

Result with ExtensionManagementUtility::addPageTSConfig()

  • backend layouts are removed (e. g. 2_columns >)
  • mod.SHARED.colPos_list is added
  • rows.6 is added
  • config.backend_layout.rowCount gets overridden with ‘6’
  • name of 3.columns.1.name gets overridden

Question: Is there a difference between the processing of page.tsconfig and ExtensionManagementUtility::addPageTSConfig()?

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 1

History 4

  1. Garvin Hicking commented and changed category <span data-processor="relativetime" data-value="2024-07-11T19:36:45+00:00" > 07/11/24, 19:36 </span>

    I can’t answer the question right now, but to possibly reproduce this, can you tell if your extension lists bootstrap_package as a dependency, so the loading order should be proper?

  2. Christoph Erdmann commented <span data-processor="relativetime" data-value="2024-07-12T11:00:33+00:00" > 07/12/24, 11:00 </span>

    Yes, the extension bootstrap_package has been correctly defined as dependency.

  3. Julian Hofmann commented and changed attached Bildschirmfoto 2025-07-09 um 08.56.52.png <span data-processor="relativetime" data-value="2025-07-09T07:02:07+00:00" > 07/09/25, 07:02 </span>

    `page.tsconfig` is loaded before the `sys_template`-records.

    Usually, your root-systemplate should clear other TypoScript. For this, there are checkboxes in the `sys_template`-record. Deactivation of both of them should solve your problem.

    Mixing `page.tsconfig` and `sys_templates` is a bit confusing (for TYPO3 and the integrators). It would be better to decide for one or the other per project.

  4. Benni Mack commented and changed status New Closed <span data-processor="relativetime" data-value="2026-11-19T13:34:05+00:00" > 11/19/26, 13:34 </span>

    Thanks for the detailed report, this actually was a problem with v12, but not anymore,.

    bootstrap_package 14.x registers its backend layouts via addPageTSConfig() in ext_localconf.php. So your page.tsconfig is parsed before the layouts exist: the > unsets run into nothing, and bootstrap_package sets rowCount and the column names afterwards again. New keys like rows.6 survive, which is exactly what you see. The dependency on bootstrap_package does not help here, as it only sorts within each of the two groups, not across them.

    With TYPO3 v14, addPageTSConfig() and defaultPageTSconfig are removed (deprecated with #101799 in v13), so there is only one place left, ordered by package dependencies. bootstrap_package 15.x also ships Configuration/page.tsconfig, so a sitepackage depending on it is loaded afterwards and the overrides work as expected.

    For v12 with bootstrap_package 14.x, either keep using addPageTSConfig() in your sitepackage, or put the overrides into the site’s page.tsconfig / page properties of the root page, which are loaded after the global TSconfig.

    Changing the loading order in 12.4 would break existing setups, so I’m closing this issue. Feel free to reopen if the problem persists with v13+ and bootstrap_package 15.x.