Blame view

frontend/views/blog/_article.php 2.95 KB
c237629a   Anastasia   first commit
1
2
3
  <?php
      
      use artbox\core\helpers\ImageHelper;
c237629a   Anastasia   first commit
4
5
6
7
8
      use artbox\core\helpers\Url;
      
      /**
       * @var \common\models\blog\Article $model
       */
28e5312e   alex   Настройка аналити...
9
10
11
  # значения вынесены, потому что эти данные нужны не только в самой картинке, а и для микроразметки
  $imageWidth=360;
  $imageHeight=240;
c237629a   Anastasia   first commit
12
13
  ?>
  
0f275925   alex   Подлатал imageman...
14
  
0f275925   alex   Подлатал imageman...
15
  
28e5312e   alex   Настройка аналити...
16
  
d9c166d7   alex   Перевёл почти все...
17
18
    <div class="blog-list-link"><a href="<?=Url::to(['alias' => $model->language->alias])?>">
            <span><?=$model->body_preview?></span></a></div>
68e72651   Anastasia   - blog
19
20
21
22
23
24
25
    <?php if (!empty($model->tags)){?>
    <div class="blog-list-tags">
      <?php foreach ($model->tags as $tag){?>
      <a href="<?=Url::to(['alias' => $tag->language->alias])?>"><?=$tag->title?></a>
      <?php } ?>
    </div>
    <?php } ?>
28e5312e   alex   Настройка аналити...
26
27
28
29
  
  
  <div itemtype="http://schema.org/Article" itemscope class="blog-list-wr">
  
675756d6   alex   исправление микро...
30
      <div itemscope itemtype="https://schema.org/ImageObject" class="img-blog-list">
28e5312e   alex   Настройка аналити...
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  
          <meta itemprop="url" content="<?=($model->image) ? $model->image->getPath() : null;?>">
          <meta itemprop="height" content="<?=$imageWidth;?>"/>
          <meta itemprop="width" content="<?=$imageHeight;?>"/>
  
          <a href="<?=Url::to(['alias' => $model->language->alias])?>">
              <!--360x240-->
  
  
              <?=ImageHelper::set(($model->image) ? $model->image->getPath() : null)
                  ->cropResize($imageWidth, $imageHeight)
                  ->quality(84)
                  ->renderImage(['alt'=>$model->language->attributes['title'],'title'=>$model->language->attributes['title']])?>
          </a>
  
  
  
      </div>
  
      <div class="blog-all-date-views">
675756d6   alex   исправление микро...
51
52
53
54
  
          <metacontent
          ="<?= date('d-m-Y', $model->created_at); ?>"/>
          <div itemprop="datePublished" class="blog-date"><?= date('d-m-Y', $model->created_at) ?></div>
28e5312e   alex   Настройка аналити...
55
56
57
58
59
60
61
          <div class="blog-views-comments-ico">
              <div class="blog-comments-ico"><?=count($model->comments)?></div>
              <div class="blog-views-ico"><?=$model->views?></div>
          </div>
      </div>
  
  
4a98a44b   alex   отредактировал ша...
62
      <meta itemprop="headline" content="XXX"/> <?= $model->title; ?>
28e5312e   alex   Настройка аналити...
63
64
65
66
  
      <div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
  
  
4a98a44b   alex   отредактировал ша...
67
          <meta itemprop="name" content="<?= \Yii::t('app', 'ABC short'); ?>">
675756d6   alex   исправление микро...
68
69
          <meta itemprop="logo"
                content="<?= 'https://as01.epimg.net/epik/imagenes/2018/03/10/portada/1520705351_010030_1520705450_noticia_normal.jpg'; ?>">
28e5312e   alex   Настройка аналити...
70
71
72
73
74
  
      </div>
  
      <div itemprop="author" itemscope itemtype="https://schema.org/Person">
  
4a98a44b   alex   отредактировал ша...
75
          <meta itemprop="name" content="<?= Url::home(true) ?>"/>
28e5312e   alex   Настройка аналити...
76
77
78
  
      </div>
  
4a98a44b   alex   отредактировал ша...
79
      <p itemprop="description"><?= $model->body_preview; ?></p>
28e5312e   alex   Настройка аналити...
80
81
82
  
      <div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
  
675756d6   alex   исправление микро...
83
84
          <meta itemprop="url"
                content="<?= 'https://as01.epimg.net/epik/imagenes/2018/03/10/portada/1520705351_010030_1520705450_noticia_normal.jpg'; ?>">
28e5312e   alex   Настройка аналити...
85
  
4a98a44b   alex   отредактировал ша...
86
          <meta itemprop="height" content="<?= $imageHeight; ?>"/>
28e5312e   alex   Настройка аналити...
87
  
4a98a44b   alex   отредактировал ша...
88
          <meta itemprop="width" content="<?= $imageWidth; ?>"/>
28e5312e   alex   Настройка аналити...
89
90
      </div>
  </div>