TYPO3 Agency - coding, design and website development

Jazykový prepínač

Riešenie

Vytvorené jazyky v TYPO3 backend-e

(defaultný - slovenský jazyk - nie je zobrazený)

 Vytvorené jazyky v TYPO3

Typoscript setup


config.linkVars = L

[globalVar = GP:L=0]
  config {
    sys_language_uid = 0
    language = sk
    locale_all = sk_SK
  }

[globalVar = GP:L=1]
  config {
    sys_language_uid = 1
    language = de
    locale_all = de_DE
    sys_language_mode = content_fallback; 1,0
  }

[globalVar = GP:L=2]
  config {
    sys_language_uid = 2
    language = en
    locale_all = en_GB
    sys_language_mode = content_fallback; 2,0
  }
[global]

lib.menuLang = HMENU
lib.menuLang {
  special = language
  special.value = 0, 2, 1
  special.normalWhenNoLanguage = 1
}
lib.menuLang.1 = TMENU
lib.menuLang.1 {
  wrap = <ul>|</ul>
  noBlur = 1
  NO {
    allWrap = <li>|</li>
    ATagTitle =  Slovak || English || Deutsch
    stdWrap.setCurrent = SK || EN || DE
    stdWrap.current = 1
  }
  CUR = 1
  CUR < .NO
  ACT = 1
  ACT < .CUR
}

page = PAGE
page.10 < lib.menuLang

Výsledok


<ul>
<li><a href="sk/examples/language-switch/" title="Slovak">SK</a></li>
<li><a href="en/examples/language-switch/" title="English">EN</a></li>
<li><a href="de/examples/language-switch/" title="Deutsch">DE</a></li>
</ul>