Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Templates Typo3为模板添加多语言支持_Templates_Typo3_Typoscript - Fatal编程技术网

Templates Typo3为模板添加多语言支持

Templates Typo3为模板添加多语言支持,templates,typo3,typoscript,Templates,Typo3,Typoscript,我尝试为typo3页面添加多语言支持。我只是想加载的内容,模板翻译是不需要的 我发现,我必须添加这些信息: “css样式的内容” styles.content.get = CONTENT styles.content.get { table = tt_content select.orderBy = sorting select.where = colPos=0 select.languageField =

我尝试为typo3页面添加多语言支持。我只是想加载的内容,模板翻译是不需要的

我发现,我必须添加这些信息:

“css样式的内容”

 styles.content.get = CONTENT 
    styles.content.get { 
        table = tt_content 
        select.orderBy = sorting    
        select.where = colPos=0 
        select.languageField = sys_language_uid 
    }
我在模板中找到的唯一提示是以下代码:

subparts.CONTENTMITTE < styles.content.get
    subparts.CONTENTMITTE{
  renderObj  < plugin.tx_rgaccordion1
  renderObj.image.20.maxW = 495
  renderObj.textpic.20.maxW = 495
      renderObj.stdWrap.wrap = <div class="contentelement">|<div class="klearer"></div></div>
      }
subparts.contentmitt
这是插入这些信息的正确位置吗

下一步是什么?我需要做什么?这会自动检测url中的“?L=2”吗


感谢您的帮助!

多语言应该可以使用css_样式的扩展,因此您不需要在那里更改任何内容

启用多语言的步骤非常简单

  • 将新网站语言添加到根页面
  • 创建页面/内容翻译
  • 配置TS模板
  • 添加在TS设置中切换typo3语言的条件,并且应该这样做
  • TS设置示例(默认为英语-无需添加,德语为id为1的网站语言)


    哇,谢谢,到目前为止,这一切都成功了!现在我还有两个问题:-如果我想让浏览者选择不同的语言,我如何在模板中添加链接“如果页面被翻译,请给浏览者一个指向domain.com/其他语言/链接其余部分的链接”即使中间有一个/de/或没有-如果系统只是部分翻译,我如何让系统在没有/en/的情况下在站点中生成链接,或重定向到/de/?您需要使用特殊情况下的HMENU,这里有一个en/de语言的示例:谢谢,这工作非常好!我是否只能显示到翻译的链接ons我不看atm?如果我看fr,我想看de和en。如果我看de,我想看fr和en,依此类推。
    # Forcing the typo to display original elements where there are no translations 
    config.sys_language_overlay = content_fallback     
    # L is parameter that's used to determine the language, make it unique
    config.linkVars = L , type
    
    config.sys_language_uid = 0
    config.language = en
    config.locale_all = en_EN
    
    # English Language
    [globalVar = GP:L =0]
    config.sys_language_uid = 0
    config.language = en
    config.locale_all = en_EN
    
    # German
    [globalVar = GP:L =1]
    config.sys_language_uid = 1
    config.language = de
    config.locale_all = de_DE
    [global]