wide_widget_9may.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * @var $post \app\models\News
  4. * @var \yii\data\ActiveDataProvider $newsDataProvider
  5. * @var \app\models\base\NewsTopic | \app\models\base\Story $topic
  6. * @var \app\models\Design $design
  7. */
  8. if( $topic instanceof \app\models\base\NewsTopic ) $url = '/news/';
  9. if( $topic instanceof \app\models\base\Story ) $url = '/story/';
  10. if( $topic instanceof \app\models\base\Tags ) $url = '/tags/';
  11. $post = Yii::$app->cache->getOrSet("main-page-wide-widget9-".$design->id,function () use($newsDataProvider){
  12. return $newsDataProvider->models[0];
  13. },600);
  14. ?>
  15. <div class="wide-widget row partner-news" style="background-color: #516985;padding: 9px 0px;">
  16. <div class="col-md-8">
  17. <div class="cont">
  18. <?php if($post->image instanceof \app\models\base\Image):?>
  19. <div class="picture-cont-16x9">
  20. <picture class="w-100">
  21. <source srcset="<?=$post->image->url?>" media="(min-width: 600px)">
  22. <img src="<?=$post->image->url?>" alt="<?=htmlentities($post->photo_title,ENT_QUOTES)?>" class="w-100" loading="lazy">
  23. </picture>
  24. </div>
  25. <?php endif;?>
  26. <div class="meta">
  27. <h2 class="title">
  28. <a href="<?=$post->url?>"><?=$post->title?></a>
  29. </h2>
  30. <div class="topic">
  31. <a href="<?=$design->url!=""?$design->url:$url.$topic->url?>" class="wwt"><?=$design->title!=""?$design->title:$topic->title?></a>
  32. </div>
  33. <?php
  34. $comments = $post->commentsAll;
  35. if(!is_null($comments)){
  36. $count=count($comments);
  37. } else{
  38. $count = 0;
  39. }
  40. ?>
  41. <?php if($count>0 || 1):?>
  42. <div class="commnets">&nbsp;<svg class="icon icon-comments"><use xlink:href="/svg/symbol/sprite-clear.svg#comments"></use></svg><?=$count?></div>
  43. <?php endif;?>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="d-flex col-md-4" style="align-items: center;background-image: url(/img/bg-radio.jpg);background-clip: content-box;background-size: contain;">
  48. <div class="cont" style="text-align:center;width:100%">
  49. <iframe width="99%" height="225" src="https://www.youtube.com/embed/videoseries?list=PLZuTpNfhNHuuUO454fh7VnVn9_mHJzuwS&controls=0&autoplay=0&loop=1&modestbranding=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
  50. </div>
  51. </div>
  52. </div>