Skip to content

Commit 824b097

Browse files
author
Igor Chepurnoy
authored
Merge pull request #17 from corpsepk/patch-1
Added microdata (schema.org)
2 parents 6f0fa99 + 0cf6beb commit 824b097

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

widgets/views/_list.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
?>
1111
<?php if (!empty($comments)) : ?>
1212
<?php foreach ($comments as $comment) : ?>
13-
<li class="comment" id="comment-<?php echo $comment->id ?>">
13+
<li class="comment" id="comment-<?php echo $comment->id ?>" itemscope itemtype="http://schema.org/Comment">
1414
<div class="comment-content" data-comment-content-id="<?php echo $comment->id ?>">
1515
<div class="comment-author-avatar">
1616
<?php echo Html::img($comment->getAvatar(), ['alt' => $comment->getAuthorName()]); ?>
@@ -26,13 +26,15 @@
2626
<?php endif; ?>
2727
</div>
2828
<?php endif; ?>
29-
<div class="comment-author-name">
30-
<span><?php echo $comment->getAuthorName(); ?></span>
29+
<?php echo Html::tag('meta', null, ['content' => Yii::$app->formatter->asDatetime($comment->createdAt, 'php:c'), 'itemprop' => 'dateCreated']); ?>
30+
<?php echo Html::tag('meta', null, ['content' => Yii::$app->formatter->asDatetime($comment->updatedAt, 'php:c'), 'itemprop' => 'dateModified']); ?>
31+
<div class="comment-author-name" itemprop="creator" itemscope itemtype="http://schema.org/Person">
32+
<span itemprop="name"><?php echo $comment->getAuthorName(); ?></span>
3133
<span class="comment-date">
3234
<?php echo $comment->getPostedDate(); ?>
3335
</span>
3436
</div>
35-
<div class="comment-body">
37+
<div class="comment-body" itemprop="text">
3638
<?php echo $comment->getContent(); ?>
3739
</div>
3840
</div>

0 commit comments

Comments
 (0)