问题描述
我有以下问题: 语言回退对网格元素的内容不起作用。网格元素本身(例如它的标题)作为后备,但不显示内容。 即使我根本不翻译页面并且完整的页面内容回退到回退(然后只有菜单链接和硬编码翻译),也会出现问题。
到目前为止,我对这个问题几乎一无所知(准确地说,几乎没有发现),如果有人能给我一个正确的方向,我会很高兴。
YAML 配置:
languages:
-
title: Deutsch
enabled: true
languageId: 0
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: ''
hreflang: ''
direction: ltr
flag: de
-
title: English
enabled: true
languageId: 1
base: en/
typo3Language: en
locale: en_GB.UTF-8
iso-639-1: en
navigationTitle: English
hreflang: en-EN
direction: ltr
fallbackType: fallback
fallbacks: '0'
flag: gb
-
title: Nederlands
enabled: true
languageId: 2
base: nl/
typo3Language: nl
locale: nl_NL.UTF-8
iso-639-1: nl
navigationTitle: Nederlands
hreflang: nl-NL
direction: ltr
fallbackType: fallback
fallbacks: '1,0'
flag: nl
-
title: Polskie
enabled: true
languageId: 3
base: pl/
typo3Language: pl
locale: pl_PL.UTF-8
iso-639-1: pl
navigationTitle: Polskie
hreflang: pl-PL
direction: ltr
fallbackType: fallback
fallbacks: '1,0'
flag: pl
配置:
config {
colCount = 2
rowCount = 1
rows {
1 {
columns {
1 {
name = Left
colPos = 20
allowed {
CType = shortcut,textmedia,iconlist,link-list-teaser,form_formframework
}
}
2 {
name = Right
colPos = 21
allowed {
CType = shortcut,form_formframework
}
}
}
}
}
}
设置:
tt_content.gridelements_pi1.20.10.setup {
grid-50-50 < lib.gridelements.defaultGridSetup
grid-50-50 {
cObject = FLUIDTEMPLATE
cObject {
partialRootPaths < lib.contentElement.partialRootPaths
templateRootPaths < lib.contentElement.templateRootPaths
layoutRootPaths < lib.contentElement.layoutRootPaths
file = EXT:XXX/Resources/Private/Content/Gridelements/grid-50-50/Template.html
}
}
}
HTML:
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:layout name="Gridelements"/>
<f:section name="Main">
<div class="row">
<div class="columns small-12 tablet-6">{data.tx_gridelements_view_column_20 -> f:format.raw()}</div>
<div class="columns small-12 tablet-6">{data.tx_gridelements_view_column_21 -> f:format.raw()}</div>
</div>
</f:section>
</html>
解决方法
能否请您检查 \GridElementsTeam\Gridelements\Plugin\Gridelements::getChildren
并在那里制作 $element 的调试输出?
通常它应该是包含子元素的父容器的 UID。
在该方法中,子语言是通过$this->languageAspect->getContentId()
确定的,因此实际上应该正确考虑回退值。
要检查这一点,也要对 getContentId() 进行调试输出。
我目前的猜测是,容器 ID 本身可能有误,或者 languageAspect 缺少回退信息。
如果它们包含错误的值,请在 https://gitlab.com/coderscare/gridelements/-/issues
提交错误报告