sgalinski / languagevisibility
TYPO3中的扩展语言可见性处理
5.0.6
2024-09-06 17:56 UTC
Requires
- typo3/cms-core: ^12.4
- dev-master
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- v4.x-dev
- 4.0.16
- 4.0.15
- 4.0.14
- 4.0.13
- 4.0.12
- 4.0.11
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.11
- 3.6.10
- 3.6.9
- 3.6.5
- 3.6.4
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.0
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.13
- 3.1.12
- 3.1.11
- 3.1.10
- 3.1.9
- 3.1.8
- 3.1.7
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.1.14
- 2.1.13
- 2.1.12
- 2.1.11
- 2.1.10
- 2.1.9
- 2.1.8
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.0
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.x-dev
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.1
- 1.0.0
This package is not auto-updated.
Last update: 2024-09-20 16:21:43 UTC
README
许可: GNU GPL, 版本 2
仓库: https://gitlab.sgalinski.de/typo3/languagevisibility
配置
使用以下TypoScript代码在FE中设置您的语言行为
config.sys_language_mode = ignore
config.sys_language_overlay = 1
//normal language configuration:
config.sys_language_uid = 0
config.language = en
config.htmlTag_langKey = en
config.locale_all = en_GB.utf8
//deutsch
[globalVar = GP:L=1]
config.sys_language_uid = 1
config.language = de
config.htmlTag_langKey = de
config.locale_all = de_DE.utf8
[global]
...
为自有记录使用languagevisibility
需要进行3个步骤
- 扩展您的表以包含所需的字段和TCA
- 将您的表注册到languagevisibility核心
- 使用正确的代码以实现所需的功能
1. 扩展您的表
将此定义添加到您的表TCA配置中
'tx_languagevisibility_visibility' => [
'exclude' => 1,
'label' => 'LLL:EXT:languagevisibility/locallang_db.xlf:pages.tx_languagevisibility_visibility',
'config' => [
'type' => 'user',
'renderType' => 'languageVisibility'
]
];
并在ext_tables.sql中添加
tx_languagevisibility_visibility text NOT NULL
2. 注册您的表
使用现有的注册钩子
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['languagevisibility']['recordElementSupportedTables'][<table>]= [];
(这将像默认记录元素一样处理您的表。如果您需要更多控制,也可以注册自己的可见性元素类)
注意
如果您想直接使用Doctrine Querybuilder访问数据,并且语言可见性很重要,您需要手动添加以下代码
if (FrontendServices::isSupportedTable($tableName)) {
if (FrontendServices::checkVisiblityForElement($row, $tableName, $languageUid)) {
return;
}
}