intermundia / yiicms
包包含核心模型、迁移、行为、控制器等。适用于Yii2 CMS
Requires
- apollo11/yii2-logger: ^v1.3.0
- kartik-v/yii2-widget-select2: *
- yiisoft/yii2: ~2.0.0
- dev-master
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- 4.0.1
- 4.0.0
- v3.0.15
- v3.0.14
- v3.0.13
- v3.0.12
- v3.0.11
- v3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.37-rc
- v2.3.36-rc
- v2.3.35-rc
- v2.3.34-rc
- v2.3.33-rc
- v2.3.32
- v2.3.32-rc
- v2.3.31
- v2.3.30-rc
- v2.3.29-rc
- v2.3.28-rc
- v2.3.27-rc
- v2.3.26-rc
- v2.3.25-rc
- v2.3.24-rc
- v2.3.23-rc
- v2.3.22-rc
- v2.3.21-rc
- v2.3.20-rc
- v2.3.19-rc
- v2.3.18-rc
- v2.3.17-rc
- v2.3.16-rc
- v2.3.15-rc
- v2.3.14-rc
- v2.3.13-rc
- v2.3.12-rc
- v2.3.11-rc
- v2.3.10-rc
- v2.3.9-rc
- v2.3.8-rc
- v2.3.7-rc
- v2.3.6-rc
- v2.3.5-rc
- v2.3.4.1
- v2.3.4.0
- v2.3.4-rc
- v2.3.3-rc
- v2.3.2-rc
- v2.3.1-rc
- v2.3.0-rc
- v2.2.0-rc
- v2.1.0-rc
- v2.0.0-rc
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.3-rc
- v1.2.2
- v1.2.2-rc
- v1.2.1
- v1.2.1-rc
- v1.2.0
- v1.2.0-rc
- v1.1.18
- v1.1.17
- v1.1.16
- v1.1.15
- v1.1.14
- v1.1.13
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.5-rc
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.20
- v1.0.19
- v1.0.18
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.6-rc
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-fix-linked-content-bug
- dev-master-v2
- dev-fix-filemanager-path-copy
- dev-dev-v2
- dev-fix-copy-language
- dev-fix-find-content-tree-by-full-path
- dev-multisite-domain-config-improvement
- dev-update-website-copy
- dev-fix-go-to-parent-button-disable-check
- dev-clear-chache-on-update-delete
- dev-url-generation-fix
- dev-only-language-specific-pages
- dev-relative-storage-url
- dev-multisite-live-editing
- dev-multisite-url
- dev-search-in-basemodel
- dev-multisite-url-fix
- dev-sync-search-fix
- dev-choose-from-existing-modal-fix
- dev-alias-language-url-fix
- dev-multisite-domain-frontend-backend-config
- dev-implement-filemanager-item-ordering
- dev-improvements-for-seed-project
- dev-corporate-data
- dev-website-update-fix
- dev-dev
- dev-move-backend-logic-into-core
- dev-timeline-events-as-separate-module
- dev-backend-restrictions
- dev-language-picker-widget
- dev-sitemap-xml-generation
- dev-ckeditor-airmode
- dev-image-optimization
- dev-add-new-html-helper
- dev-website-specific-timeline-events
- dev-fix-alias-generation
- dev-url-replace-problems
- dev-create-copy-helper-class
This package is auto-updated.
Last update: 2024-09-12 18:58:24 UTC
README
包包含核心模型、迁移、行为、控制器等,适用于Yii2 CMS
安装
通过composer安装此扩展是首选方式。
运行以下命令之一:
php composer.phar require --prefer-dist intermundia/yiicms "*"
或
"intermundia/yiicms": "*"
将以下内容添加到您的composer.json
文件的require部分。
从单站升级到多站
重要!!!
确保您没有覆盖ContentTree::getActiveTranslation
和BaseModel::getActiveTranslation
方法
-
在
console/config.php
中添加用户组件'user' => [ 'class' => \intermundia\yiicms\web\User::class, 'enableSession' => false, 'identityClass' => \intermundia\yiicms\models\User::class ]
-
在
console/config.php
中添加控制器'sync' => [ 'class' => \intermundia\yiicms\console\controllers\SyncController::class, ], 'utils' => [ 'class' => \intermundia\yiicms\console\controllers\UtilsController::class, ],
-
在
common/config/base.php
中配置mulsitecore
组件。如果您想为不同的环境有不同的域名,最好创建一个忽略文件并将其包含在multisitecore
配置中'websites' => [ 'website key1' => [ 'defaultContentId' => "content tree id", 'masterLanguage' => 'en-US', "storageUrl" => 'storage url', "domains" => [ 'domain1' => 'en-US', 'domain2' => 'en-US', ] ], 'website key2' => [ 'defaultContentId' => "content tree id", 'masterLanguage' => 'en-US', "storageUrl" => 'storage url', "domains" => [ 'domain1' => 'en-US', 'domain2' => 'en-US', ] ] ]
更新内容:每个域名现在可以对应以下格式的关联数组
'domain1' => [ 'language' => 'en-US', 'isProduction' => false, 'isFrontend' => true ]
完整示例
'mywebsite.com' => [ 'defaultContentId' => 1234, 'masterLanguage' => 'en-US', "storageUrl" => 'mywebsite.com/storage/web', "domains" => [ 'mywebsite.com' => [ 'language' => 'en-US', 'isProduction' => true, 'isFrontend' => true ], 'admin.mywebsite.com' => 'en-US', // You can leave en-US as string which means that isProduction and isFrontend both are false ] ]
-
将控制台脚本添加到
./migrate
bash脚本的第一行,以运行核心迁移php console/yii migrate --migrationPath=@cmsCore/migrations
-
运行迁移
./migrate
-
从“en”切换到“en-US”语言
php console/yii utils/switch-language en en-US
-
从多站核心网站读取语言并将其插入到语言表中
php console/yii sync/languages
-
在内容树中添加网站
php console/yii sync/websites
-
将
frontend/controllers/ContentTreeController
设置为扩展核心的FrontendContentTreeController
-
当您已经运行
php console/yii sync/websites
时,复制网站内容php console/yii utils/copy-language $fromWebsiteKey $toWebsiteKey $from $to
-
在网站内复制语言
php console/yii utils/add-language $websiteKey $from $to
要更新别名、别名路径和相应的文件管理器项,请运行
php console/yii utils/fix-alias-and-file-manager-items $websiteKey
SluggableBehavior
将更新属于提供$websiteKey
的content_tree_translation
表中的每个记录的alias
和alias_path
属性。相应的file_manager_item
记录也会更新。
Usersnap
对于usersnap网站翻译模型有两个参数,usersnap_code,其中应输入从usersnap.com获得的代码,以及type。有3种不同类型
Disabled
。在这种情况下,usersnap不会显示Always display
。在这种情况下,usersnap始终可见Display if url has usersnap=1 in get
(如果您想访问usersnap并选择此选项,您应将任何get参数usersnap
传递到url一次,这将保存状态到会话中,并显示usersnap,直到会话过期或手动删除)