承接 sgalinski/languagevisibility 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sgalinski/languagevisibility

最新稳定版本:6.1.3

Composer 安装命令:

composer require sgalinski/languagevisibility

包简介

Control TYPO3 frontend language visibility and fallback behavior with flexible TypoScript-based configuration.

README 文档

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:

  1. Extend your table with the required field and TCA
  2. Register your table to the languagevisibility core
  3. 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;
    }
}

统计信息

  • 总下载量: 1.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2017-09-04