[英]Typo3 9.5: Language Fallback does not work with gridelements
我有以下問題:語言后備不適用於網格元素的內容。 網格元素本身(例如它的標題)用作后備,但不顯示內容。 即使我根本不翻譯頁面並且完整的頁面內容回退到后備(然后只有菜單鏈接和硬編碼翻譯),也會出現問題。
到目前為止,我幾乎沒有找到關於這個問題的信息(准確地說,幾乎沒有),如果有人能給我推動正確的方向,我會很高興。
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,textmedia,iconlist,link-list-teaser,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 的 output 嗎?
通常它應該是包含子元素的父容器的 UID。 在該方法中,子語言由$this->languageAspect->getContentId()
確定,因此實際上應該正確考慮后備值。
要檢查這一點,請調試 getContentId() 的 output。
我目前的猜測是,容器 ID 本身可能是錯誤的,或者 languageAspect 缺少回退信息。
如果它們包含錯誤的值,請在https://gitlab.com/coderscare/gridelements/-/issues提交錯誤報告
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.