How to set up Variants for Entry Points of additional languages in TYPO3

跟風遠走 提交于 2019-12-24 06:10:34

问题


The final domains of the project will be:

  1. www.domain.com (english, main language, L=0)
  2. www.domain.de (german, L=1)

The development/preview domains are

  1. dev.domain.com
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!