abdualiym/yii2-cms

Yii2 little cms extension

Installs: 246

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0

Type:yii2-extension

2.0.4 2020-10-21 14:14 UTC

This package is auto-updated.

Last update: 2024-04-21 22:12:13 UTC


README

The extension allows manage html content block.

Installation

  • Install with composer:
composer require abdualiym/yii2-cms "^1.0"
  • After composer install run console command for create tables:
php yii migrate/up --migrationPath=@vendor/abdualiym/yii2-cms/migrations
  • Setup in common config storage and language configurations.

language indexes related with database columns.

Admin panel tabs render by array values order

'modules' => [
    'cms' => [ // don`t change module key
        'class' => '@abdualiym\cms\Module',
        'storageRoot' => $params['staticPath'],
        'storageHost' => $params['staticHostInfo'],
        'thumbs' => [ // 'sm' and 'md' keys are reserved
            'admin' => ['width' => 128, 'height' => 128],
            'thumb' => ['width' => 320, 'height' => 320],
        ],
        'languages' => [
            'ru' => [
                'id' => 0,
                'name' => 'Русский',
            ],
            'uz' => [
                'id' => 1,
                'name' => 'O`zbek tili',
            ],
        ],
        'menuActions' => [ // for add to menu controller actions
            '' => 'Home',
            'site/contacts' => 'Contacts',
        ]
    ],
],
  • In admin panel add belove links for manage pages, article categories, articles and menu:
/cms/pages/index
/cms/article-categories/index
/cms/articles/index
/cms/menu/index

CKEditor use Elfinder plugin for save files and images. Refer Elfinder readme for proper configuration

###Examples

Extension registers next language arrays to Yii::$app->params[] for use in views:

\Yii::$app->params['cms']['languageIds'][$prefix] = $language['id'];
[
    'en' => 2,
    'ru' => 1,
    ...
]

\Yii::$app->params['cms']['languages'][$prefix] = $language['name'];
[
    'en' => 'English',
    ...
]


\Yii::$app->params['cms']['languages2'][$language['id']] = $language['name'];
[
    2 => 'English',
    ...
]

###Examples for use in frontend see yii2-language extension

TODO

  • Copy from extension root directory example widgets for frontend integration