<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<span itemprop="ratingValue"><?= $averagerating ?></span>
<span itemprop="ratingCount"><?= $ratingcount ?></span>
<span itemprop="reviewCount"><?= $reviewcount ?></span></div>
@bzcomputers that assumes that Google search results would pull ratings from individual web sites which is not usually the case. Google uses Google Reviews ratings and ratings from certain large rating sites like Yelp but you're not likely going to see much benefit from your individual forum ratings, other than for your members.
All the above.In what way do you see benefits? Ranking? Do the rating stars show up in search results?
Template xfrm_resource_view have code for microdata application/ld+json, but google not show stars in the SERPsBecause the resource page template does not include Rating Schema.
Something as simple as integrating microdata like this would do it:
HTML:<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"> <span itemprop="ratingValue"><?= $averagerating ?></span> <span itemprop="ratingCount"><?= $ratingcount ?></span> <span itemprop="reviewCount"><?= $reviewcount ?></span></div>
sorry for my bad English<script type="application/ld+json">
{
"@type": "CreativeWork",
"@id": "{{ link('canonical:resources', $resource)|escape('json') }}",
"name": "{$resource.title|escape('json')}",
"headline": "{$resource.title|escape('json')}",
"alternativeHeadline": "{$resource.tag_line|escape('json')}",
"description": "{$descSnippet|escape('json')}",
<xf:if is="$resource.isVersioned()">
"version": "{$resource.CurrentVersion.version_string|escape('json')}",
</xf:if>
<xf:if is="$xf.options.xfrmAllowIcons AND $resource.icon_date">
"thumbnailUrl": "{{ $resource.getIconUrl('s', true)|escape('json') }}",
</xf:if>
"dateCreated": "{{ date($resource.resource_date, 'c')|escape('json') }}",
"dateModified": "{{ date($resource.last_update, 'c')|escape('json') }}",
<xf:if is="$resource.rating_count">"aggregateRating": {
"@type": "AggregateRating",
"ratingCount": "{$resource.rating_count|escape('json')}",
"ratingValue": "{$resource.rating_avg|escape('json')}"
},</xf:if>
<xf:if is="$resource.hasViewableDiscussion()">
"discussionUrl": "{{ link('canonical:threads', $resource.Discussion)|escape('json') }}",
</xf:if>
"author": {
"@type": "Person",
"name": "{{ ($resource.User ? $resource.User.username : $resource.username)|escape('json') }}"
}
}
</script>
Yeah, I didn't see the ld+json code before. It looks fine so it should be able to produce enhanced search results. Of course Google will always have the last say, but as for schema integration it appears correct.Template xfrm_resource_view have code for microdata application/ld+json, but google not show stars in the SERPs
sorry for my bad English
yes, code xfrm_resource_view not contains @context": "http://schema.org" and some other values, so there are no starsThis sounds like an issue i posted about recently
Is the code above the fix?yes, code xfrm_resource_view not contains @context": "http://schema.org" and some other values, so there are no stars
I fixed it for my forum, well see google reaction
I've had trouble with the Rich Test Results also at times. It appears you need to be logged in to Google and the site domain needs to be a property in your Google Search Console, then the results typically come through. It may be set this may so that only the site owner can test results on their domain.@bzcomputers
So in line 15, just change it to "@type": "Course", if my resources are online courses?
Is that the only thing done to get it to work on google?
I tried the rich result test but it ALWAYS timed out. Not sure if the source code is buggy
Rich Results Test - Google Search Console
search.google.com
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Course",
"name": "Introduction to Computer Science and Programming",
"description": "Introductory CS course laying out the basics.",
"provider": {
"@type": "Organization",
"name": "University of Technology - Eureka",
"sameAs": "http://www.ut-eureka.edu"
}
}
</script>
We use essential cookies to make this site work, and optional cookies to enhance your experience.