TYPO3:lang属性在html标记中更改(HTML5样板样式)
我使用这个配置来遵循HTML5样板TYPO3:lang属性在html标记中更改(HTML5样板样式),typo3,typoscript,html5boilerplate,Typo3,Typoscript,Html5boilerplate,我使用这个配置来遵循HTML5样板 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 i
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]--
}
config{
doctype=html_5
doctype(
)
htmlTag_setParams=lang=“de”class=“no js no ie”>使用公共TS条件设置正确的config.htmlTag_setParams
,您可能正在使用它来切换语言
[globalVar = GP:L = 1]
config.sys_language_uid = 1
config.language = en
config.htmlTag_setParams = lang="en" class="no-js no-ie"><!--<![endif]--
[GLOBAL]
[globalVar=GP:L=1]
config.sys\u language\u uid=1
config.language=en
config.htmlTag_setParams=lang=“en”class=“no js no ie”>可能是很久以前的事了,但我会为谷歌回答。
除了@biesior对条件的建议之外,您还可以为语言使用一个常量来避免不必要的重复代码
设置:
config {
doctype (
<!--[if lt IE 7 ]> <html lang="{config.language}" class="no-js ie6"> <![endif]-->
...
)
}
尝试:
是的,我想到了,但似乎有很多重复的代码,因为语言的数量可能会增长很多。没有像{page:language}和insertData这样的解决方案吗?我知道这些都不起作用,很遗憾……只是为了记录:paul irish html标记也可以在“PageRenderTemplateFile”中设置,从typo3/sysext/cms/tslib/templates/tslib_page_frontend.html复制它,并通过config.pagerendertemplatefile进行设置。我最初认为它可以解决您的问题,但我不确定如何访问此模板中的标记(有很多,但可能您无法添加自己的标记)
[globalVar = GP:L = 1]
config {
language = en
}
[global]
[globalVar = GP:L = 2]
config {
language = de
}
[global]
...
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 = #
}
}
}
config {
htmlTag_langKey = de
}