我有一个TYPO3页面,其中包含默认语言和英语两种语言。
现在,当我按下辅助语言上的查看按钮以获取带有URL www.domain.de/home/?L=2
的prview页面时。但该页面是德语版本,而不是英文版本?
我使用realurl可能是问题吗?
更新Typoscript
#xhtml_cleaning = all damit wird mit "/" ausgegeben
uniqueLinkVars = 1
linkVars = L(1-3)
sys_language_uid = 0
sys_language_overlay = hideNonTranslated
sys_language_mode = content_fallback
language = de
locale_all = de_DE.UTF-8
htmlTag_langKey = de
intTarget = _self
extTarget = _blank
}
和这个
CONTENTMAIN = CONTENT
CONTENTMAIN.table = tt_content
CONTENTMAIN.select.where = colPos = 0
CONTENTMAIN.select.languageField = sys_language_uid
CONTENTMAIN.select.orderBy = sorting
更新: 实际完整的Typoscript(设置)
# Responsive Design Optimization
tt_content.image.20 {
imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap1"> | </div>
imageColumnStdWrap.dataWrap = <div class="csc-textpic-imagecolumn"> | </div>
}
tt_content.image.20 {
rendering {
dl {
imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow"> | </div>
imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last"> | </div>
oneImageStdWrap.dataWrap = <dl class="csc-textpic-image###CLASSES###" > | </dl>
}
ul {
imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow"><ul> | </ul></div>
imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last"><ul> | </ul></div>
oneImageStdWrap.dataWrap = <li class="csc-textpic-image###CLASSES###"> | </li>
}
div {
imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow"> | </div>
imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last"> | </div>
oneImageStdWrap.dataWrap = <div class="csc-textpic-image###CLASSES###"> | </div>
}
simple {
imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap csc-textpic-single-image"> | </div>
}
}
}
tt_content.image.20 {
renderMethod = figure
rendering {
figure {
imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow"> | </div>
imageLastRowStdWrap.dataWrap = <div class="csc-textpic-imagerow csc-textpic-imagerow-last"> | </div>
noRowsStdWrap.wrap =
oneImageStdWrap.dataWrap = <figure class="csc-textpic-image"> | </figure>
imgTagStdWrap.wrap = |
editIconsStdWrap.wrap = <div> | </div>
caption.wrap = <figcaption> | </figcaption>
caption.required = 1
}
}
}
#CONFIGURATION####################
[globalVar = GP:L = 2]
config {
sys_language_uid = 2
language = en
locale_all = en_US.UTF-8
htmlTag_langKey = en
}
[global]
config {
# headerComment (
#Diese Seite wurde erstellt von:
#DeWo Werbeagentur OHG
#Zuständig für Layout-Umsetzung
#dewo.de
#)
doctype = html5
renderCharset = utf-8
metaCharset = utf-8
prefixLocalAnchors = all
simulateStaticDocuments = 0
tx_realurl_enable = 1
absRefPrefix = /
spamProtectEmailAddresses = 2
spamProtectEmailAddresses_atSubst = (at)
// Cache settings
cache_period = 43200
#Entfernt Kommentare um die content elements
disablePrefixComment = 1
index_enable = 1
removeDefaultJS = external
admPanel = 1
sendCacheHeaders = 1
#xhtml_cleaning = all damit wird mit "/" ausgegeben
uniqueLinkVars = 1
linkVars = L(1-3)
sys_language_uid = 0
sys_language_overlay = hideNonTranslated
sys_language_mode = content_fallback
language = de
locale_all = de_DE.UTF-8
htmlTag_langKey = de
intTarget = _self
extTarget = _blank
}
page = PAGE
page {
typeNum = 0
shortcutIcon = fileadmin/bilder/favicon.png
appletouchicon =
insertClassesFromRTE = 1
adminPanelStyles = 1
# The meta Tags for the page.
meta {
# Description - auslesen und ggf. vererben wenn kein entry auf single page
description.data = page:description
description.ifEmpty.data = levelfield :-1, description, slide
# Keywords - auslesen und ggf. vererben wenn kein entry auf single page
keywords.data = page:keywords
keywords.ifEmpty.data = levelfield :-1, keywords, slide
keywords.keywords = 1
date.data = page:SYS_LASTCHANGED // page:crdate;
date.date = Y-m-d
author =
publisher =
copyright =
PAGE-TOPIC = Information
PAGE-TYPE = Information
language.data = TSFE:lang
robots = index, follow
siteinfo = robots.txt
revisit-after = 7 days
viewport = width = device-width, initial-scale=1.0
}
includeJSlibs {
jquery = fileadmin/config/script/js/jquery-1.11.1.min.js
jquery.forceOnTop = 1
}
includeCSS {
#a standard Grid system based on the boilertemplate
boil = fileadmin/config/script/css/boilerplate.css
boil.media = screen
boil.forceOnTop = 1
# our own navigation stylesheet
mefish = fileadmin/config/script/css/megafish.css
mefish.media = only screen and (min-width: 768px)
mefish.forceOnTop = 0
# Grid file based on the boilertemplate
grid = fileadmin/config/script/css/grid.css
grid.media = screen
grid.forceOnTop = 0
# our own stylesheet
flex = fileadmin/config/script/css/flexslider_styles.css
flex.media = screen
flex.forceOnTop = 0
# icon font
awe = fileadmin/config/script/font-awesome-4.0.3/css/font-awesome.min.css
awe.media = screen
awe.forceOnTop = 0
# IndexSearch Template
indexSearch = fileadmin/customDesign/indexsearch/css/indexsearch-style.css
indexSearch.media = screen
indexSearch.forceOnTop = 0
}
}
# END Page object
# blendet Subnavi aus,
[globalVar = TSFE:page|layout = 1]
page.includeCSS {
subnav = fileadmin/config/script/css/subnavi.css
subnav.media = screen
subnav.forceOnTop = 0
}
[global]
)
page.20 = TEMPLATE
page.20.template = FILE
page.20.template.file = fileadmin/config/script/template/template.html
page.20 {
workOnSubpart = DOCUMENT
marks {
#links
INHALTOBEN = CONTENT
INHALTOBEN.table = tt_content
INHALTOBEN.select.where = colPos = 1
INHALTOBEN.select.languageField = sys_language_uid
INHALTOBEN.select.orderBy = sorting
#normal
CONTENTMAIN = CONTENT
CONTENTMAIN.table = tt_content
CONTENTMAIN.select.where = colPos = 0
CONTENTMAIN.select.languageField = sys_language_uid
CONTENTMAIN.select.orderBy = sorting
#rechts
CONTENTASIDE = CONTENT
CONTENTASIDE.table = tt_content
CONTENTASIDE.select.where = colPos = 2
CONTENTASIDE.select.languageField = sys_language_uid
CONTENTASIDE.select.orderBy = sorting
#rand
OBEN = CONTENT
OBEN.table = tt_content
OBEN.select.where = colPos = 3
OBEN.select.languageField = sys_language_uid
OBEN.select.orderBy = sorting
#Hier in Zeile 220 die id von der Seite 'static' eingeben (Änderung 15.05.14 Florian Kasischke)
#NAVISTATIC = HMENU
#NAVISTATIC.special = directory
#NAVISTATIC.special.value =
#NAVISTATIC.excludeUidList = ,
#NAVISTATIC {
#1 = TMENU
#1 {
#expAll = 1
#wrap = <ul class="headernavmenu">|</ul>
#noBlur = 1
#NO = 1
#NO.ATagTitle.field = title
#NO.wrapItemAndSub = <li>|</li>
#NO.allWrap = | I |*| | I |*| |
#ACT < .NO
#ACT.ATagParams = class="active_static"
#}
#}
BREAD = HMENU
BREAD {
special = rootline
special.range = 0 | 2
1 = TMENU
1.NO.ATagTitle.field = title
1.NO.ATagParams = class="staticbread"
1.NO.allWrap = | / |*| | / |*| |
}
NAVIMAIN = HMENU
NAVIMAIN.entryLevel = 0
#NAVIMAIN.excludeUidList =
NAVIMAIN {
1 = TMENU
1 {
expAll = 1
wrap = <ul class="sf-menu">|</ul>
noBlur = 1
NO = 1
NO.ATagTitle.field = title
NO.wrapItemAndSub = <li>|</li>
ACT = 1
ACT.ATagParams = class="act"
ACT.wrapItemAndSub = <li> |</li>
}
2 = TMENU
2 {
expAll = 1
maxItems = 10
wrap = <div class="sf-mega">|</div>
NO = 1
NO {
ATagTitle.field = title
wrapItemAndSub = <div class="sf-mega-section">|</div>
stdWrap.wrap = |
ATagParams = class="headermega"
stdWrap.htmlSpecialChars = 1
doNotLinkIt = 0
}
}
3 = TMENU
3 {
expAll = 1
maxItems = 20
wrap = <ul>|</ul>
NO = 1
NO {
ATagTitle.field = title
linkWrap = <li>|</li>
}
ACT = 1
ACT {
wrapItemAndSub = <li>|</li>
ATagParams = class="active"
}
}
#4 < .3
}
NAVIOFF = HMENU
NAVIOFF.entryLevel = 0
#NAVIOFF.excludeUidList =
NAVIOFF {
1 = TMENU
1 {
expAll = 1
wrap = <ul class="sf-menu">|</ul>
noBlur = 1
NO = 1
NO.ATagTitle.field = title
NO.wrapItemAndSub = <li>|</li>
IFSUB = 1
IFSUB < .NO
IFSUB.ATagParams = class="pfeile"
ACT = 1
ACT < .NO
ACT.ATagParams = class="menuakt"
CUR = 1
CUR < .ACT
}
2 < .1
2.wrap = <ul>|</ul>
2.NO.wrapItemAndSub = <li class="first"> |</li> |*| <li> |</li> |*| <li class="last"> | </li>
2.ACT = 0
3 < .2
4 < .2
}
SUBNAVI = HMENU
SUBNAVI.entryLevel = 1
SUBNAVI.excludeUidList = 3,754,68
SUBNAVI {
1 = TMENU
1 {
expAll = 1
wrap = <ul>|</ul>
noBlur = 1
NO = 1
NO.ATagTitle.field = title
NO.ATagParams = style="border-bottom:2px solid rgba(255, 255, 255, 0.8);"
NO.wrapItemAndSub = <li>|</li>
IFSUB = 1
IFSUB < .NO
#IFSUB.stdWrap.dataWrap=| ▾
#▾
#IFSUB.ATagParams = class="pfeile"
ACT < .NO
ACT.ATagParams = class="subactive"
#IFSUB = 1
# IFSUB.wrapItemAndSub = <li class="menuparent">|</li>
#ACTIFSUB < .IFSUB
# wenn unterseiten vorhanden, dann kann Icon angezeigt werden
# IFSUB = 1
# IFSUB.stdWrap.dataWrap=» |
}
2 < .1
2 {
expAll = 0
}
3 < .2
3 = TMENU
3 {
expAll = 1
NO.ATagParams = style="padding-left:1.5rem;font-size:0.875rem;"
ACT < .NO
ACT.ATagParams = class="subactive" style="padding-left:1.5rem;font-size:0.875rem;"
}
#4 < .3
}
}
}
## Localization menu:
lib.langMenu = HMENU
lib.langMenu {
special = language
special.value = 0,1,2
special.normalWhenNoLanguage = 0
1 = GMENU
1.NO {
XY = [5.w]+4, [5.h]+4
backColor = white
5 = IMAGE
5.file = EXT:cms/tslib/media/flags/flag_uk.gif || EXT:cms/tslib/media/flags/flag_de.gif
5.offset = 2,2
}
1.ACT < lib.langMenu.1.NO
1.ACT=1
1.ACT.backColor = black
1.USERDEF1 < lib.langMenu.1.NO
1.USERDEF1=1
1.USERDEF1.5.file = EXT:cms/tslib/media/flags/flag_uk.gif || EXT:cms/tslib/media/flags/flag_de.gif
1.USERDEF1.noLink = 0
1.USERDEF2 < lib.langMenu.1.USERDEF1
1.USERDEF2.backColor = green
}
答案 0 :(得分:1)
您需要包含根据L
参数的值更改语言的配置:
config {
sys_language_uid = 0
language = de
locale_all = de_DE.UTF-8
htmlTag_langKey = de
}
[globalVar = GP:L = 2]
config {
sys_language_uid = 2
language = en
locale_all = en_US.UTF-8
htmlTag_langKey = en
}
[global]
对具有一致语言ID(语言记录的uid)的所有语言重复此操作。
编辑:条件块应低于语言0的默认块;补充说。
答案 1 :(得分:1)
你的typoscript顶部有语言切换条件。稍后您使用默认值config.sys_language_uid
覆盖0
。
所以你必须把你的条件置于你的错别字的底部。