Commit 68b181f0135b3108afff3fb1db916801391696ab
1 parent
0783894b
Slider resizer
Showing
3 changed files
with
24 additions
and
5 deletions
Show diff stats
common/config/bootstrap.php
| ... | ... | @@ -5,6 +5,6 @@ Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend'); |
| 5 | 5 | Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console'); |
| 6 | 6 | Yii::setAlias('@storage', dirname(dirname(__DIR__)) . '/storage'); |
| 7 | 7 | Yii::setAlias('storage', dirname(dirname(__DIR__)) . '/storage'); |
| 8 | -Yii::setAlias('@imagesDir', dirname(dirname(__DIR__)) . '/frontend/web/images'); | |
| 9 | -Yii::setAlias('@imagesUrl', '/images'); | |
| 8 | +Yii::setAlias('@imagesDir', dirname(dirname(__DIR__)) . '/storage'); | |
| 9 | +Yii::setAlias('@imagesUrl', '/storage'); | |
| 10 | 10 | ... | ... |
common/config/main.php
| ... | ... | @@ -72,8 +72,8 @@ return [ |
| 72 | 72 | 'artboximage' => [ |
| 73 | 73 | 'class' => 'common\components\artboximage\ArtboxImage', |
| 74 | 74 | 'driver' => 'GD', //GD or Imagick |
| 75 | - 'rootPath' => Yii::getAlias('@frontend/web/images'), | |
| 76 | - 'rootUrl' => Yii::getAlias('/images'), | |
| 75 | + 'rootPath' => Yii::getAlias('@storage'), | |
| 76 | + 'rootUrl' => Yii::getAlias('/storage'), | |
| 77 | 77 | 'presets' => [ |
| 78 | 78 | 'product' => [ |
| 79 | 79 | 'resize' => [ |
| ... | ... | @@ -127,6 +127,24 @@ return [ |
| 127 | 127 | 'master' => null |
| 128 | 128 | ], |
| 129 | 129 | ], |
| 130 | + 'event_list' => [ | |
| 131 | + 'resize' => [ | |
| 132 | + 'width' => 200, | |
| 133 | + 'height' => 200, | |
| 134 | + 'master' => null | |
| 135 | + ], | |
| 136 | + ], | |
| 137 | + 'slider' => [ | |
| 138 | + 'resize' => [ | |
| 139 | + 'width' => 1920, | |
| 140 | + 'height' => null, | |
| 141 | + 'master' => 'width' | |
| 142 | + ], | |
| 143 | + 'crop' => [ | |
| 144 | + 'width' => 1920, | |
| 145 | + 'height' => 480 | |
| 146 | + ] | |
| 147 | + ], | |
| 130 | 148 | ] |
| 131 | 149 | ], |
| 132 | 150 | ], | ... | ... |
frontend/widgets/views/slider.php
| ... | ... | @@ -7,9 +7,10 @@ use yii\helpers\Url; |
| 7 | 7 | ?> |
| 8 | 8 | <div class="carousel"> |
| 9 | 9 | <?php foreach($slider->sliderImage as $image): |
| 10 | + $img = \common\components\artboximage\ArtboxImageHelper::getImageSrc($image->imageUrl , 'slider'); | |
| 10 | 11 | $htm = <<<HTML |
| 11 | 12 | |
| 12 | - <div style="background:url($image->image ) center center no-repeat;width:100%;height:480px;position:absolute;"> | |
| 13 | + <div style="background:url($img ) center center no-repeat;width:100%;height:480px;position:absolute;"> | |
| 13 | 14 | </div> |
| 14 | 15 | <div class="content"> |
| 15 | 16 | ... | ... |