_article.php
2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
use artbox\core\helpers\ImageHelper;
use artbox\core\helpers\Url;
/**
* @var \common\models\blog\Article $model
*/
# значения вынесены, потому что эти данные нужны не только в самой картинке, а и для микроразметки
$imageWidth=360;
$imageHeight=240;
?>
<div class="blog-list-link"><a href="<?=Url::to(['alias' => $model->language->alias])?>">
<span><?=$model->body_preview?></span></a></div>
<?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 } ?>
<div itemtype="http://schema.org/Article" itemscope class="blog-list-wr">
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject" class="img-blog-list">
<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">
<metacontent="<?=date('d.m.Y', $model->created_at);?>"/>
<div itemprop="datePublished" class="blog-date"><?=date('d.m.Y', $model->created_at)?></div>
<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>
<meta itemprop="headline" content="XXX"/> где ХХХ название статьи в H1
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<meta itemprop="name" content="НАЗВАНИЕ САЙТА">
</div>
<div itemprop="author" itemscope itemtype="https://schema.org/Person">
<meta itemprop="name" content="НАЗВАНИЕ САЙТА"/>
</div>
<p itemprop="description">ОПИСАНИЕ</p>
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="КАРТИНКА">
<meta itemprop="height" content="675"/>
<meta itemprop="width" content="900"/>
</div>
</div>