metatag;
$metaBaseInfo = Yii::$app->metabaseinfo;
//
$image = $metaBaseInfo->getBaseUrl() . '/' . $model->getImageLink();
$imagePath = $model->getImagePath();
$link = $model->getUrl();
if ($image === null) {
$image = $metaBaseInfo->getBaseUrl() . '/images/blog-1.jpg';
$image = $imagePath;
}
list($width, $height, $type, $attr) = getimagesize($image);
//
$meta->set_image_url($image);
$metaBaseInfoLogo = $metaBaseInfo->getSiteLogo();
try {
list($widthl, $heightl, $typel, $attrl) = getimagesize($metaBaseInfoLogo);
} catch (Exception $exception) {
}
?>
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"headline": "= Html::encode($model['lang']['title']) ?>",
"image": {
"@type": "ImageObject",
"url": "= $image ?>",
"height": "= $height??0 ?>",
"width": "= $width??0 ?>"
},
"datePublished": "= $model->getPublishedTimeISO() ?>",
"dateModified": "= $model->getModifiedTimeISO() ?>",
"author": {
"@type": "Person",
"name": "= $params->getByName('shop_name') ?>"
},
"publisher": {
"@type": "Organization",
"name": "= $params->getByName('shop_name') ?>",
"logo": {
"@type": "ImageObject",
"width": "= $widthl??0 ?>",
"height": "= $heightl??0 ?>",
"url": "= $metaBaseInfoLogo ?>"
}
},
"description": "= Html::encode($model['lang']['description']) ?>"
}