1
0
mirror of https://github.com/e107inc/e107.git synced 2025-09-02 02:42:40 +02:00

#5422 Support for schema. News schema added and FAQs schema template simplified.

This commit is contained in:
camer0n
2025-01-31 11:54:19 -08:00
parent ec61237c03
commit b05fea833c
11 changed files with 599 additions and 211 deletions

View File

@@ -88,6 +88,7 @@ $NEWS_VIEW_TEMPLATE['default']['item'] = '
';
/*
* <hr />
<h3>About the Author</h3>
@@ -101,6 +102,38 @@ $NEWS_VIEW_TEMPLATE['default']['item'] = '
</div>
*/
$NEWS_VIEW_TEMPLATE['default']['schema'] = '
{
"@context": "https://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{NEWS_URL: full=1}"
},
"headline": "{NEWS_TITLE}",
"description": "{NEWS_DESCRIPTION}",
"image": [
"{SETIMAGE: w=800&h=800}{NEWS_IMAGE: item=1&return=url}"
],
"author": {
"@type": "Person",
"name": "{NEWS_AUTHOR=nolink}"
},
"publisher": {
"@type": "Organization",
"name": "{ORGANIZATION}",
"logo": {
"@type": "ImageObject",
"url": "{SITEBUTTON: type=url}"
}
},
"datePublished": "{NEWS_DATE=atom}",
"dateModified": "{NEWS_MODIFIED=atom}",
"articleBody": "{NEWS_BODY=raw}"
}
';
// @todo add more templates. eg. 'videos' , 'slideshow images', 'full width image' - help and ideas always appreciated.