LobiCMS core
Package contains core models, migrations, behaviors, controllers etc. for the LobiCMS
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist apollo11/lobi-cms-core "*"
or add
"apollo11/lobi-cms-core": "*"
to the require section of your composer.json
file.
Upgrading from single site to Multi site
Important!!!
Make sure you do not override ContentTree::getActiveTranslation
and BaseModel::getActiveTranslation
methods
-
Add user component in
console/config.php
'user' => [ 'class' => \apollo11\lobicms\web\User::class, 'enableSession' => false, 'identityClass' => \apollo11\lobicms\models\User::class ]
-
Add controllers in
console/config.php
'sync' => [ 'class' => \apollo11\lobicms\console\controllers\SyncController::class, ], 'utils' => [ 'class' => \apollo11\lobicms\console\controllers\UtilsController::class, ],
-
Configure
mulsitecore
component incommon/config/base.php
If you want to have different domains for different environments, better to create ignored file and include insidemultisitecore
config'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', ] ] ]
-
Add console script to run core migrations in
./migrate
bash script as the first linephp console/yii migrate --migrationPath=@vendor/apollo11/lobi-cms-core/migrations
-
Run migration
./migrate
-
For switch language from 'en' to 'en-US'
php console/yii utils/switch-language en en-US
-
Read languages from multiSiteCore websites and insert it in language table
php console/yii sync/languages
-
Add websites in contentTree
php console/yii sync/websites
-
Make
frontend/controllers/ContentTreeController
to be extend of core'sFrontendContentTreeController
-
To copy the website content when you have already run
php console/yii sync/websites
php console/yii utils/copy-language $fromWebsiteKey $toWebsiteKey $from $to
-
Copy language inside website
php console/yii utils/add-language $websiteKey $from $to