Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TYPO3: lang attribute changed in html tag (HTML5boilerplate style)

I use this configuration to follow with the HTML5boilerplate.

config{
    doctype = html_5

    doctype(
        <!doctype html>
        <!--[if lt IE 7 ]> <html lang="de" class="no-js ie6"> <![endif]-->
        <!--[if IE 7 ]>    <html lang="de" class="no-js ie7"> <![endif]-->
        <!--[if IE 8 ]>    <html lang="de" class="no-js ie8"> <![endif]-->
        <!--[if IE 9 ]>    <html lang="de" class="no-js ie9"> <![endif]-->
        <!--[if (gt IE 9)|!(IE)]><!-->
    )
    htmlTag_setParams = lang="de" class="no-js no-ie"><!--<![endif]--
}

The problem is that when I have a site with several alternative languages, the langattribute doesnt update.

Does anyone have an idea how to solve this?

like image 629
Enrique Moreno Tent Avatar asked Dec 26 '22 07:12

Enrique Moreno Tent


2 Answers

Use common TS conditions to set proper config.htmlTag_setParams which you are probably using for switching the language...

[globalVar = GP:L = 1]
  config.sys_language_uid = 1
  config.language = en
  config.htmlTag_setParams = lang="en" class="no-js no-ie"><!--<![endif]--
[GLOBAL]
like image 92
biesior Avatar answered Mar 16 '23 17:03

biesior


Try:

config {

  htmlTag_stdWrap {
    setContentToCurrent = 1
    cObject = COA
    cObject {
        appendMeTemp = TEXT
        appendMeTemp.append = TEXT
        appendMeTemp.append.char = 10
        appendMeTemp.current = 1

        // IE7
        20 < .appendMeTemp
        20.addParams.class = ie ie7
        20.wrap = <!--[if IE 7 ]>|<![endif]-->

        // IE8
        30 < .appendMeTemp
        30.addParams.class = ie ie8
        30.wrap = <!--[if IE 8 ]>|<![endif]-->

        // IE9
        40 < .appendMeTemp
        40.addParams.class = ie ie9
        40.wrap = <!--[if IE 9 ]>|<![endif]-->

        60 < .appendMeTemp
        60.wrap = <!--[if (gte IE 9)|!(IE)]> # <![endif]-->
        60.wrap.splitChar = #
      }
   }         
}

Then standard:

config {
    htmlTag_langKey = de
}
like image 23
Krystian Szymukowicz Avatar answered Mar 16 '23 18:03

Krystian Szymukowicz