t3g/file-variants
Composer 安装命令:
composer require t3g/file-variants
包简介
Working prototype for translatable files in TYPO3
README 文档
README
This extension serves as a working prototype for translatable files in TYPO3.
Features
- Upload language variants using the File list module to provide variants transparently throughout the system.
- Replace or remove variants (which resets to the file of the default language).
- Metadata records are can be translated just like before, but no longer point to the same file record.
- File records are translatable, but not directly accessible. All editing is done through metadata records.
Limits
- Providing file variants is only possible in File list module.
- Usage of
sys_language_uid=-1(All languages) is deactivated.
Setup
- Install extension via Composer:
composer require pagemachine/typo3-file-variants - Activate the extension
- (optional) Use the extension configuration to create a dedicated file storage. If you use no dedicated storage, a dedicated folder will be used in default storage.
Data Examples
- Default language English, uid 0
- First language German (Deutsch), uid 1
- Second language Spain (Español), uid 2
- Third language Russian (Русский), uid 3
sys_file
| uid | sys_language_uid | l10n_parent | filename |
|---|---|---|---|
| 1 | 0 | 0 | en.pdf |
| 2 | 1 | 1 | de.pdf |
| 3 | 2 | 1 | en.pdf |
(Notice that there is no Russian variant here.)
sys_file_metadata
| uid | sys_language_uid | l10n_parent | file | title |
|---|---|---|---|---|
| 1 | 0 | 0 | 1 | English |
| 2 | 1 | 1 | 2 | Deutsch |
| 3 | 2 | 1 | 3 | Español |
tt_content
| uid | sys_language_uid | l10n_parent | media | title |
|---|---|---|---|---|
| 1 | 0 | 0 | 1 | English |
| 2 | 1 | 1 | 1 | Deutsch |
| 3 | 2 | 1 | 1 | Español |
| 4 | 3 | 1 | 1 | Русский |
sys_file_reference
local is sys_file, foreign is tt_content
| uid | sys_language_uid | l10n_parent | uid_local | uid_foreign |
|---|---|---|---|---|
| 1 | 0 | 0 | 1 | 1 |
| 2 | 1 | 1 | 2 | 2 |
| 3 | 2 | 1 | 3 | 3 |
| 4 | 3 | 1 | 1 | 4 |
Schematically the following relations exist and are created/maintained automatically:
tt_content:1(English) ->sys_file_reference:1->sys_file:1(English)tt_content:2(German) ->sys_file_reference:2->sys_file:2(German)tt_content:3(Spanish) ->sys_file_reference:3->sys_file:3(Spanish)tt_content:4(Russian) ->sys_file_reference:4->sys_file:1(English)
Behaviour
After Installation, the file metadata (sys_file_metadata) edit mask in File
list module is slightly changed. Nothing changes for the default language. But
creating / editing a file metadata translation allows for uploading a new file
for this translation. The upload works the same way as the File list module and
can be found next to the file info. This file will reside in the dedicated
translation storage or folder. After uploading, the fileinfo element changes
its content and displays the uploaded file.
A button then allows for resetting to the file used in default language. The file formerly used here is removed permanently! Also, the upload control is displayed again, so the a new file can be uploaded at any time.
During this process, all file references (sys_file_reference) are searched
for a link to the default file, and updated with the translated one.
On each translation action to any record that contains a FAL field (like files or images), a check is performed to find out whether a file variant for the target language is available. If it is, the resulting file reference will link to that file variant instead of the default file.
This results in a consistent behaviour, that summarizes as:
- If a variant is available for a specific language, it will be used, everywhere and everytime.
- If no variant is available for a specific language, the default file is used (current standard TYPO3 behaviour).
Missing Features
- Upgrade wizard: if file metadata translations already exist, no file variants are provided or added.
- Workspaces support.
t3g/file-variants 适用场景与选型建议
t3g/file-variants 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.12k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 12 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 t3g/file-variants 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 t3g/file-variants 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 11.12k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2020-12-23