Search code examples
typo3typoscripthtml5boilerplate

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?


Solution

  • 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]