black-lamp/yii2-articles

There is no license information available for the latest version (0.8.2) of this package.

Articles extension for the Yii framework

Installs: 520

Dependents: 2

Suggesters: 0

Security: 0

Stars: 1

Watchers: 6

Forks: 3

Open Issues: 1

Type:yii2-extension

0.8.2 2020-04-15 08:01 UTC

README

INSTALLATION

Composer require section

"black-lamp/yii2-articles": "0.*"

Migrate

php yii migrate --migrationPath=@yii/rbac/migrations
php yii migrate --migrationPath=@vendor/black-lamp/yii2-multi-lang/migration
php yii migrate --migrationPath=@vendor/black-lamp/yii2-articles/common/migrations
php yii migrate --migrationPath=@vendor/black-lamp/yii2-seo/migrations

Add articles module to your backend config

    'modules' => [
    	...
        'articles' => [
            'class' => 'bl\articles\backend\Module'
        ],
        ...
    ]

Add articles module to your frontend config

    'modules' => [
    	...
        'articles' => [
            'class' => 'bl\articles\frontend\Module'
        ],
        ...
    ]

Configure seo-url rule

	'urlManager' => [
		...
		'rules' => [
			...
			[
			    'class' => 'bl\articles\UrlRule'
			]
		]
	]

Configure Imagable module

    'components' => [
        ...
        'articles_imagable' => [
            'class' => bl\imagable\Imagable::className(),
            'imageClass' => CreateImageImagine::className(),
            'nameClass' => bl\imagable\name\CRC32Name::className(),
            'imagesPath' => '@frontend/web/images',
            'categories' => [
                'origin' => false,
                'category' => [
                    'thumbnail' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'menu_item' => [
                        'origin' => false,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                    'social' => [
                        'origin' => true,
                        'size' => [
                            'big' => [
                                'width' => 1500,
                                'height' => 500
                            ],
                            'thumb' => [
                                'width' => 500,
                                'height' => 500,
                            ],
                            'small' => [
                                'width' => 150,
                                'height' => 150
                            ]
                        ]
                    ],
                ]
            ]
        ],
    ]

Use

yourbackend.url/articles/article

**YOU MUST CONFIGURE IMAGABLE COMPONENT**

Roles and its permissions:

articleManager

  • viewArticleList
  • editArticles
  • deleteArticles

articleCategoryManager

  • viewCategoryList
  • editCategories
  • deleteCategories

articleAdministrator extends category and article manager's permissions.