如何在 TYPO3 中为其他语言的入口点设置变体 [英] How to set up Variants for Entry Points of additional languages in TYPO3

查看:21
本文介绍了如何在 TYPO3 中为其他语言的入口点设置变体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该项目的最终域将是:

  1. www.domain.com(英语,主要语言,L=0)
  2. www.domain.de(德语,L=1)

开发/预览域是

  1. dev.domain.com
  2. dev.domain.de

可以在站点配置的常规"选项卡中为主要入口点"创建一个变体:基础:https://dev.domain.com/条件:applicationContext ==开发"

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)?

推荐答案

只要您不需要其他特定于语言的配置,您就可以在您的 apache 配置中设置 env vars 并在您的站点配置中读取它们.这是官方支持的(请参阅此处)

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)

网站配置:

base: 'https://%env(BASE_DOMAIN)%/'
languages:
  -
    base: 'https://%env(BASE_DOMAIN_DE)%/'

Apache 配置(示例):

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

这篇关于如何在 TYPO3 中为其他语言的入口点设置变体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆