123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- /**
- * @var $this \yii\web\View
- * @var $topic_id integer
- */
- use app\models\base\NewsTopic;
- use app\models\base\Image;
- use app\modules\ldjson\jsonLD;
- $page = \Yii::$app->request->get('page');
- $addtpage = $page?". Страница ($page)":'';
- $topic = NewsTopic::find()->andWhere(['id'=>$topic_id])->one();
- $this->params['breadcrumbs'] = [
- [
- "text"=>$topic->title,
- "url"=>$topic->url
- ]
- ];
- $this->title = $topic->title;
- Yii::$app->og->title =$topic->title.$addtpage;
- Yii::$app->og->description =$topic->description?:'Лента подкастов - '.Yii::$app->og->description.$addtpage;
- Yii::$app->og->og_title = $topic->title;
- Yii::$app->og->og_description = Yii::$app->og->description;
- $url = str_replace( '/news/', '/', $topic->getUrl(true) );
- Yii::$app->og->canonical = $url;
- Yii::$app->og->og_type = "website";
- jsonLD::addAmicORG();
- $i = 1;
- foreach($this->params['breadcrumbs'] as $el){
- jsonLD::addBreadcrumb($i, $el['url'], $el['text']);
- $i++;
- }
- ?>
- <div class="podcasts">
- <h1><?=$this->title?></h1>
- <div class="row">
- <div class="col-md-12">
- <?php foreach (NewsTopic::find()->andWhere(["show"=>"Y","active"=>1,'topic_id'=>$topic_id])->orderBy(["order"=>SORT_ASC])->all() as $topic): /** @var $topic NewsTopic */?>
- <div class="topic_item">
- <h2 class="topic_title">
- <a href="/podcasts/<?=$topic->url?>" title="<?=$topic->title?>"><?=$topic->title?></a>
- <a href="/podcasts/<?=$topic->url?>" title="<?=$topic->title?>">
- <div class="video-list-title-link">
- <svg class="icon icon-play">
- <use xlink:href="/svg/symbol/sprite-styled.svg#play"></use>
- </svg>
- </div>
- </a>
- </h2>
- <div class="topic_items row">
- <?php
- $news = $topic->getNews()->limit(3)->all();
- foreach ($news as $post){ /** @var $post \app\models\front\News */
- echo $this->render('archive/_archive_item',["model"=>$post]);
- }
- ?>
- </div>
- </div>
- <?php endforeach;?>
- </div>
- </div>
- </div>
|