silverstripe-australia/silverstripe-multisites
最新稳定版本:5.2.6
Composer 安装命令:
composer require silverstripe-australia/silverstripe-multisites
包简介
Allows for multiple websites to be managed through a single site tree.
README 文档
README
Overview
Allows for multiple websites to be managed through a single site tree.
This is an alternative module to the Subsites module; it avoids any session tracking of the 'current' website, and doesn't perform any query modification at runtime to change the 'site' context of queries you execute
Compatible with SilverStripe 4.0.x
- Please see 4.0.x for 3.5 compatibility
- Please see the 1.2.x version for 3.1 compatibility
Upgrading to SS4
The following important changes have happened
- Themes must now be explicitly configured in your project config. Set
Site.available_themesin yml config. This must be a map of themename: Label - Site specific Assets folders are not currently supported due to the fundamental change to asset management. This will be reviewed over time
Requirements
- SilverStripe 4.*
- MultivalueField
Installation
- Add the module and the multivaluefield module
- Run
dev/build
Setting up sites (and additional sites)
- In the CMS go to the Pages section and click on the Website
- Enter in the full path to the site in the 'Host' field, without the
http://lead - egmysitedomain.comorlocalhost/sub/folderfor a development site - Hit save
- To add a new site, click the Pages section; you should have an 'Add site' button
- Enter details about the new site, the Host field being the most important
Configuration
Site:
available_themes:
name: Label
To support cascading themes, provide a comma-separated list of themes for 'name' in configuration.
Assets management
NOTE: This is currently NOT working in SS4 due to the change to the asset management layer. Once clearer, this will be re-enabled.
You can optionally manage each site's assets in it's own subfolder of the root assets/ directory. Add the following extensions in your mysite/config.yml file and run ?flush=1. When editing a Site in the CMS, you now have the option to select a subfolder of assets/ to contain all assets for that site. This folder will be automatically created upon a) saving the site or b) visiting a page in the cms that has an upload field.
FileField: extensions: - MultisitesFileFieldExtension HtmlEditorField_Toolbar: extensions: - MultisitesHtmlEditorField_ToolbarExtension
Files uploaded through the HTMLEditor will now be uploaded into assets/yoursite/Uploads. If you have custom upload fields in the cms however, you will need to add the following configuration to them explicitly.
$fields->fieldByName('Root.Main.Image')->setFolderName('images/page-images')->useMultisitesFolder();
The above call to useMultisitesFolder() will change the folder name from ' images/page-images' to 'currentsitesubfolder/images/page-images'
Known issues
When linking to a page that belongs to a different site, SiteTree::Link() will return a bad link as it prepends the base URL. Currently the best way to work around this is to implement the following in your Page.php (model class).
/** * Overrides SiteTree->Link. Adds a check for cases where we are linking to a page on a * different site in this multisites instance. * @return String **/ public function Link($action = null) { if($this->SiteID && $this->SiteID == Multisites::inst()->getCurrentSiteId()) { return parent::Link($action); } else { return $this->RelativeLink($action); } }
- See GitHub
silverstripe-australia/silverstripe-multisites 适用场景与选型建议
silverstripe-australia/silverstripe-multisites 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.9k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2015 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「silverstripe」 「subsites」 「multisites」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 silverstripe-australia/silverstripe-multisites 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 silverstripe-australia/silverstripe-multisites 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 silverstripe-australia/silverstripe-multisites 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Adds Google Analytics to the site using Gtag or Google Tag Manager.
Allows for multiple websites to be managed through a single site tree.
Adds subsite support to elements
Adds a page type that automatically builds a sitemap from the view tree. Works with Multisites module.
Analytics chooser extensions for site settings.
统计信息
- 总下载量: 11.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-01-14