sgalinski / languagevisibility
Extended Language Visibility Handling in TYPO3
5.0.11
2024-10-10 16:03 UTC
Requires
- typo3/cms-core: ^12.4
- dev-master
- 5.0.11
- 5.0.10
- 5.0.8
- 5.0.7
- 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-12-13 17:31:24 UTC
README
License: GNU GPL, Version 2
Repository: https://gitlab.sgalinski.de/typo3/languagevisibility
Configuration
Use this TypoScript code to set up your language behavior in the 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]
...
Use languagevisibility for own records
There are 3 steps to take:
- Extend your table with the required field and TCA
- Register your table to the languagevisibility core
- Use the correct code so that the desired functionality happened
1. Extend your table
Add this definition to your table TCA configuration:
'tx_languagevisibility_visibility' => [
'exclude' => 1,
'label' => 'LLL:EXT:languagevisibility/locallang_db.xlf:pages.tx_languagevisibility_visibility',
'config' => [
'type' => 'user',
'renderType' => 'languageVisibility'
]
];
And to ext_tables.sql add:
tx_languagevisibility_visibility text
2. Register your table
Use the existing registration Hook :
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['languagevisibility']['recordElementSupportedTables'][<table>]= [];
(this will handle your table like a default record element. If you need more control you can also register your own visibility element class)
Note
If you want to access the data directly with the Doctrine Querybuilder, you need to add the following code manually, if the languagevisibility matters:
if (FrontendServices::isSupportedTable($tableName)) {
if (FrontendServices::checkVisiblityForElement($row, $tableName, $languageUid)) {
return;
}
}