b13/host-variants
Composer 安装命令:
composer require b13/host-variants
包简介
Extends the base variants condition with current host.
README 文档
README
This extension allows to configure a base variant in TYPO3s Site Configuration depending on the current Host.
When is it useful?
This extension can be useful when dealing with multiple sites in one TYPO3 instance with different domains:
Let's say you have a primary domain primary-domain.tld with a site configuration.
Backend editors log in to this primary domain.
You have a site config with an own page tree for a second domain another-domain.tld.
Editors create content for the second domain on a hidden page. When previewing that
page from within the backend, another-domain.tld/some-page-slug will be shown. Since
editors are logged in to the primary domain, the backend user cookie will not be sent by
the browser for the secondary domain, the frontend does not see a logged in backend
user and will show a 404.
The extension now allows configuring a site base variant for the secondary domain that kicks in when backend preview is called from the main domain, and calls the frontend of the secondary site as a sub path of the main domain instead.
Requirements
- TYPO3 v11 LTS, v12 LTS or v13 LTS
Installation and Setup
Install the extension via your preferred way. No further setup is required. The extension works out of the box.
What it does
The extension adds a variable host to the expression language for the Site Configuration.
This allows configuring multiple domains for the same root page.
Example
Basic:
base: 'https://another-domain.tld/' baseVariants: - base: 'https://primary-domain.tld/some-sub-path' condition: 'host == "primary-domain.tld"'
Using some ENV variable:
base: 'https://another-domain.tld/' baseVariants: - base: 'https://%env(MAIN_DOMAIN)%/some-sub-path' condition: 'host == "%env(MAIN_DOMAIN)%"'
Combining conditions:
base: 'https://another-domain.tld/' baseVariants: - base: 'https://local1.local/' condition: 'applicationContext == "Development" && host == "local1.local"' - base: 'https://local2.local/' condition: 'applicationContext == "Development" && host == "local2.local"'
Made by b13 with ♥
Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.
b13/host-variants 适用场景与选型建议
b13/host-variants 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 336.38k 次下载、GitHub Stars 达 35, 最近一次更新时间为 2020 年 10 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 b13/host-variants 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 b13/host-variants 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 336.38k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 35
- 点击次数: 37
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2020-10-13