The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist infoweb-internet-solutions/yii2-cms-sliders "*"
or add
"infoweb-internet-solutions/yii2-cms-sliders": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply modify your common configuration as follows:
return [
...
'modules' => [
...
'yii2images' => [
'class' => 'rico\yii2images\Module',
// @frontend/web/
'imagesStorePath' => '@uploadsBaseUrl/img/store', //path to origin images
'imagesCachePath' => '@uploadsBaseUrl/img/cache', //path to resized copies
'graphicsLibrary' => 'GD', //but really its better to use 'Imagick'
'placeHolderPath' => '@infoweb/sliders/assets/img/placeHolder.png',
],
],
];
Run this migration
yii migrate/up --migrationPath=@infoweb/sliders/migrations
Import the translations
yii i18n/import @infoweb/sliders/messages
Add to backend/config/main.php
'modules' => [
...
'sliders' => [
'class' => 'infoweb\sliders\Module',
],
...
'cms' => [
...
'sideBarItems' => [
'modules' => [
...
[
'label' => 'Sliders',
'i18nGroup' => 'infoweb/sliders',
'url' => '/sliders/slider/index',
'authItem' => 'showSlidersModule',
'activeUrl' => 'sliders',
],
],
],
],
...
],
All available configuration options are listed below with their default values.
integer
, default: 800
)The default with (in pixels) of a new slider.
integer
, default: 200
)The default height (in pixels) of a new slider.
boolean
, default: false
)If this option is set to true
, it is possible to set a title for each image of a slider.
boolean
, default: false
)If this option is set to true
, it is possible to set a subtitle for each image of a slider.
boolean
, default: false
)If this option is set to true
, it is possible to set a description for each image of a slider.
boolean
, default: false
)If this option is set to true
, it is possible to set an url for each image of a slider.
boolean
, default: false
)If this option is set to true
, it is possible to set a position for each image text in the a slider.
Comments