4

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?

1
  • Just for the record: the paul irish html tag can also be set in the "pageRendererTemplateFile", copying it from typo3/sysext/cms/tslib/templates/tslib_page_frontend.html and setting it via config.pageRendererTemplateFile. I first thought it would solve your problem, but I'm not sure how to access Markers in this template (there are many, but probably you can't add your own) Commented Mar 22, 2013 at 20:42

3 Answers 3

5

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]
Sign up to request clarification or add additional context in comments.

1 Comment

Yeah, I thought of that, but seems like a lot of repeated code, since the number of languages could grow a lot. Is there no some sort of solution like {page:language} and insertData? I know those dont work, sadly...
4

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
}

Comments

1

Maybe quite a bit ago, but I'll answer for the googlers. In addition to @biesior 's suggestion with the conditions, you could use a constant for the language to avoid unwanted duplicate code.

Setup:

config {
    doctype (
    <!--[if lt IE 7 ]> <html lang="{config.language}" class="no-js ie6"> <![endif]-->
    ...
    )
}

Constants:

[globalVar = GP:L = 1]
    config {
        language = en
    }
[global]
[globalVar = GP:L = 2]
    config {
        language = de
    }
[global]
...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.