问题
The final domains of the project will be:
- www.domain.com (english, main language, L=0)
- www.domain.de (german, L=1)
The development/preview domains are
- dev.domain.com
- dev.domain.de
It is possible to create a Variant for the main "Entry Point" in tab "General" of the Site Configuration: Base: https://dev.domain.com/ Condition: applicationContext == "Development"
But how can I set up a variant for the second language (german)?
回答1:
as long as you need no other language specific configuration, you could set env vars in your apache configuration and read them in your site configuration. This is officially supported (see here)
Site config:
base: 'https://%env(BASE_DOMAIN)%/'
languages:
-
base: 'https://%env(BASE_DOMAIN_DE)%/'
Apache config (example):
SetEnvIf Host ".*" TYPO3_CONTEXT=Production
SetEnvIf Host ".*" BASE_DOMAIN=www.domain.com
SetEnvIf Host ".*" BASE_DOMAIN_DE=www.domain.de
SetEnvIf Host "dev.domain.com" TYPO3_CONTEXT=Development
SetEnvIf Host "dev.domain.com" BASE_DOMAIN=dev.domain.com
SetEnvIf Host "dev.domain.de" TYPO3_CONTEXT=Development
SetEnvIf Host "dev.domain.de" BASE_DOMAIN_DE=dev.domain.de
回答2:
This is not yet possible. The related issue can be checked out at https://forge.typo3.org/issues/86400.
I would solve that in the meantime by using different config.yml
files.
回答3:
Since TYPO3 v9.5.5 baseVariants can be added directly in yaml for "base" values of site languages, the same way as the default "base" property in the site.
来源:https://stackoverflow.com/questions/54852662/how-to-set-up-variants-for-entry-points-of-additional-languages-in-typo3