Search code examples
typo3typo3-9.xtypo3-extensionstypo3-10.x

TYPO3 sites config.yaml outsourced in own extension?


I searching for a Solution, how can i outsource the TYPO3 site config.yaml file in my own Extension? thanks for help!


Solution

  • You can do this by doing import statements in the config.yaml of the site.

    Like this in config/sites/main/config.yaml:

    imports:
        - { resource: 'EXT:site_mysite/Configuration/Sites/my_site_config.yaml' }
    

    In our cases a typical yaml configuration for the site looks like this:

    imports:
        - { resource: 'EXT:site_myproject/Configuration/Sites/defaults.yaml' }
    rootPageId: 401
    ... domains
    ... error handling
    

    We move everything that does not contain a Page ID (root page ID; error handling) into the site extension, to make the site extension re-usable (= language configuration or route enhancers are moved to the site extension)