PHPackages                             ut8ia/yii2-content-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ut8ia/yii2-content-module

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ut8ia/yii2-content-module
=========================

module for manage content in project

01481PHP

Since Jan 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ut8ia/yii2-content-module)[ Packagist](https://packagist.org/packages/ut8ia/yii2-content-module)[ RSS](/packages/ut8ia-yii2-content-module/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-content-module
===================

[](#yii2-content-module)

Content management functionality You can easy manage your content. You can easy display content depends on :

- section
- rubric
- navigation tag
- positioning tag ( 'header slogan' - for example )
- id
- slug

Also you can use helpers and widgets. Author of the content will be added according to *identityClass* configured in your application \*\*installing \*\* add into composer.json

```
 "ut8ia/yii2-contnent-module":"*"

```

Apply migrations

```
yii migrate --migrationPath=vendor/ut8ia/yii2-content-module/migrations
 yii migrate --migrationPath=vendor/ut8ia/yii2-multylang/migrations

```

\*\*configuration \*\* add into 'modules' section in your config file

```
    'modules' => [
        'content' =>[
            'class' => 'ut8ia\contentmodule\ContnentModule'
        ]
    ],
```

\*\* requirements \*\*

-
-

\*\* recomended \*\*

- section for config menu - for exemple , look adminmenu config

```
                'adminmenu' => [
                           'class' => ut8ia\adminmenu\Adminmenu::class,
                           'items' => [
                               0 => [
                                   'name' => 'Весь контент',
                                   'items' => [
                                       1 => [
                                           'module' => 'content',
                                           'controller' => 'content',
                                           'url' => 'index',
                                           'name' => 'Контент'],
                                       2 => [
                                           'module' => 'content',
                                           'controller' => 'tags',
                                           'name' => 'Теги',
                                           'url' => 'index'],
                                       3 => [
                                           'module' => 'content',
                                           'controller' => 'contentrubrics',
                                           'name' => 'Рубріки',
                                           'url' => 'index'],
                                       4 => [
                                           'module' => 'content',
                                           'controller' => 'contentsections',
                                           'name' => 'Секції',
                                           'url' => 'index']
                                   ]
                               ],
                           ]
```

\*\* config sections \*\* add sections to db in admin interface and configure it into modules section each section as a new -= virtual =- content module for each content section that you need. For example : content of static site interface , news section , articles . Also you can separately config admin form for each section - enable or disable futures. Each section has their personal rubricator . You can specify layout of your admin interface via 'layoutPath'.

```
    'modules' => [

        'content' => [
            'class' => 'ut8ia\contentmodule\ContentModule'
        ]
        ,
        'interface_parts' => [
            'class' => 'ut8ia\contentmodule\ContentModule',
            'sectionId' => 1,
            'positioning' => true, // show positioning tags input
            'navigationTags' => true, // show navigation tags input
            'stick' => true, // show sticky checkbox in form
            'multilanguage' =>true // show multylanguiage selector
            'displayFormat' => true // enable format dropdown in form
            'displayFormats' =>[  // configure possible values
              'simple'=>'simple format', // you can switch your rendering
              'full'=>'display this content in full template' // depends on this values
               ]
        ],
        'articles' => [
            'class' => 'ut8ia\contentmodule\ContentModule',
            'sectionId' => 2,
            'layoutPath' => '@frontend/views/layouts',
        ],
        'events' => [
            'class' => 'ut8ia\contentmodule\ContentModule',
            'sectionId' => 3
        ],
]
```

\*\* usage in views \*\*

```
