Commit f981b4b2cbb6e25f8dc75763326a07d1fd30525c

Authored by Anastasia
1 parent bde5eb58

- slide bug fix

common/models/slider/Slide.php
... ... @@ -126,6 +126,6 @@
126 126 */
127 127 public function getBackground()
128 128 {
129   - return $this->hasOne(Image::className(), [ 'id' => 'image_id' ]);
  129 + return $this->hasOne(Image::className(), [ 'id' => 'background_id' ]);
130 130 }
131 131 }
... ...
frontend/views/site/index.php
... ... @@ -24,7 +24,11 @@ _________________________________________________________ -->
24 24 <div class="homepage owl-carousel" >
25 25  
26 26 <?php foreach ($slides as $key => $slide){?>
27   - <div class="home-carousel" style="background: url(<?=$slide->background->getUrl()?>) center center repeat">
  27 + <div class="home-carousel"
  28 + <?php if ($slide->background !== null){?>
  29 + style="background: url(<?=$slide->background->getUrl()?>) center center repeat"
  30 + <?php } ?>
  31 + >
28 32 <div class="item">
29 33 <div class="row">
30 34 <div class="col-sm-5 <?=($key%2 == 0) ? 'right' : ''?>">
... ...