我是typo3的新手。我面临语言问题。我已将页面名称设置为页脚,并以两种语言(即de,en)设置了内容。
lib.content_from_page3 = COA
lib.content_from_page3 {
10 = CONTENT
10 {
table = tt_content
select.where = colPos = 0
select.pidInList = 48
}
}
lib.content_from_page4 = COA
lib.content_from_page4 {
10 = CONTENT
10 {
table = tt_content
select.where = colPos = 0
select.pidInList = 52
}
}
这是我在模板中设置的打字稿。和
<f:cObject typoscriptObjectPath="lib.content_from_page3" />
<f:cObject typoscriptObjectPath="lib.content_from_page4" />
这是访问数据的代码。 lib.content_from_page3是默认语言的内容,而lib.content_from_page4是英语。
问题是,当选择默认语言时,一切都很好,但是当选择英语时,则没有数据
答案 0 :(得分:0)
确保已正确配置了如下所示的语言
# Localization:
config {
linkVars = L(int)
sys_language_uid = 0
sys_language_overlay = 1
sys_language_mode = content_fallback
language = en
locale_all = en_US.UTF-8
htmlTag_setParams = lang="en" dir="ltr" class="no-js"
}
[globalVar = GP:L = 1]
config {
sys_language_uid = 1
language = de
locale_all = de_DE.UTF-8
htmlTag_setParams = lang="de" dir="ltr" class="no-js"
}
[global]
可能这个对象可以帮助您
lib.dynamicContent = COA
lib.dynamicContent {
10 = LOAD_REGISTER
10 {
colPos.cObject = TEXT
colPos.cObject {
field = colPos
ifEmpty.cObject = TEXT
ifEmpty.cObject {
value.current = 1
ifEmpty = 0
}
}
pageUid.cObject = TEXT
pageUid.cObject {
field = pageUid
ifEmpty.data = TSFE:id
}
contentFromPid.cObject = TEXT
contentFromPid.cObject {
data = DB:pages:{register:pageUid}:content_from_pid
data.insertData = 1
}
wrap.cObject = TEXT
wrap.cObject {
field = wrap
}
}
20 = CONTENT
20 {
table = tt_content
select {
includeRecordsWithoutDefaultTranslation = 1
orderBy = sorting
where = {#colPos}={register:colPos}
where.insertData = 1
pidInList.data = register:pageUid
pidInList.override.data = register:contentFromPid
}
stdWrap {
dataWrap = {register:wrap}
required = 1
}
}
30 = RESTORE_REGISTER
}
并将其放在您的模板文件中
< f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '0',pageUid:'52'}" />
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '0',pageUid:'48'}" />
如果上面的物体不能帮助您,请尝试在下面的物体
lib.content_from_page3 = COA
lib.content_from_page3 {
10 = CONTENT
10 {
table = tt_content
select {
pidInList = {$config.logopageId}
where = colPos = 0
max = 1
languageField = sys_language_uid
}
}
}
让我知道您是否需要任何帮助!
欢迎使用TYPO3!:)