소스 검색

video block fix

amic 1 년 전
부모
커밋
9b36270a11
1개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 3
      views/site/index/wide_widget_video.php

+ 8 - 3
views/site/index/wide_widget_video.php

@@ -10,18 +10,19 @@ use app\models\base\Image;
 if( $topic instanceof \app\models\base\NewsTopic ) $url = '/news/';
 if( $topic instanceof \app\models\base\Story ) $url = '/story/';
 if( $topic instanceof \app\models\base\Tags ) $url = '/tags/';
-
+try{
 $post = Yii::$app->cache->getOrSet("main-page-wide-video-".$design->id,function () use($newsDataProvider){
    return $newsDataProvider->models[0];
 },600);
 $model = $post;
 $preview = $model->image;
 $key = 'okey';
+
 ?>
 <div class="row partner-news"  style="height-min:360px">
     <div class="col-md-8">
         <div class="cont">
-			<iframe width="100%" height="100%" style="aspect-ratio: 16 / 9;" src="https://www.youtube.com/embed/5FNI26lPfgE" title="Crystal Bay Yacht Club | Lamai | Koh Samui | Thailand | Live Beach Webcam | 2160p 4K" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
+			<iframe width="100%" height="100%" style="aspect-ratio: 16 / 9;" src="https://www.youtube.com/embed/5FNI26lPfgE?autoplay=1" title="Crystal Bay Yacht Club | Lamai | Koh Samui | Thailand | Live Beach Webcam | 2160p 4K" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
         </div>
     </div>
     <div class="col-md-4" >
@@ -38,7 +39,7 @@ $key = 'okey';
             <?php endif;?>
             <div class="meta">
                 <h2 class="title"><?=$model->title?></h2>
-                <div class="lead" style="font-size: 17px;"><?=$model->lid?></div>
+                <div class="lead" style="font-size: 17px; color: #888;"><?=$model->lid?></div>
                 <div class="published_at">
                     <?=$model->publishedAt?>
                     <?php
@@ -53,3 +54,7 @@ $key = 'okey';
     </div>
     </div>
 </div>
+<?
+} catch (Exception $e) {
+	echo "\n<!-- нет подвязанных новостей (блок с видео)-->\n";
+}