测试信息页面结构化标签

hotfix/paypal-note
LiaoYijun 4 years ago
parent 02be4434e3
commit d87a6cdbca

@ -618,7 +618,8 @@ class Information extends CI_Controller
//H1模板替换
$data_H1 = array();
$data_H1['infocategory'] = $this->Information_model->get_detail_by_path($information->is_path, 1); //信息所属分类,获取信息顶级节点内容
$data_H1['author'] = $this->Operator_model->get_author_nikename($information->ic_author); //获取作者信息
$author_nickname = $this->Operator_model->get_author_nikename($information->ic_author);
$data_H1['author'] = $author_nickname; //获取作者信息
$data_H1['ic_title'] = $information->ic_title;
$data_H1['ic_photo'] = $information->ic_photo;
$data_H1['breadcrumb_data'] = $breadcrumb_data;
@ -627,6 +628,14 @@ class Information extends CI_Controller
$addthis_widget = $this->load->view($template_path . '-add-this', false, true);
$template = str_replace('<!--@ADDTHIS-WIDGET@-->', $addthis_widget, $template);
if ($information->is_id == '278006460') {
$article_structured_data_content = $this->load->view(
$template_path . '-structured-data-article',
array('information' => $information, 'author_nickname' => $author_nickname),
true);
$template = str_replace('<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->', $article_structured_data_content, $template);
}
} else {
$template = str_replace('<!--@PRODUCT-JS@-->', '<script src="https://data.chinahighlights.com/js/flatpickr.js"></script>', $template);
$inquiry_form_template = $this->load->view($template_path . '-inquiry-form', array('meta_product_code' => $meta_product_code), true);

@ -514,5 +514,6 @@
}
</script>
<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->
<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->
</body>
</html>

@ -0,0 +1,28 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://www.chinahighlights.com<?php echo $information->ic_url; ?>"
},
"headline": "<?php echo $information->ic_seo_title; ?>",
"image": [
"https://images.chinahighlights.com<?php echo $information->ic_photo; ?>"
],
"datePublished": "<?php echo $information->is_datetime; ?>",
"dateModified": "<?php echo time(); ?>",
"author": {
"@type": "Person",
"name": "<?php echo $author_nickname; ?>"
},
"publisher": {
"@type": "Organization",
"name": "China Highlights",
"logo": {
"@type": "ImageObject",
"url": "https://data.chinahighlights.com/pic/logo/china-highlights-top-navigation-logo.png"
}
}
}
</script>

@ -376,5 +376,6 @@
}
</script>
<!--@STRUCTURED-DATA-BREADCRUMB-BLOCK@-->
<!--@STRUCTURED-DATA-ARTICLE-BLOCK@-->
</body>
</html>
Loading…
Cancel
Save