COMMUNITY FORUM
Rating Schema Snippet for K2 Articles
- Arnold Wender
- Offline
- New Member
Less
More
9 years 7 months ago #131156
by Arnold Wender
Replied by Arnold Wender on topic Re: Rating Schema Snippet for K2 Articles
I have exactly the same code but if you check with an extension like Semantic inspector:
goo.gl/35SwuP
You will see that ratingCount adds:
1Vote
in German:
1Stimme
Instead of just the number...
Cheers
Arnold
goo.gl/35SwuP
You will see that ratingCount adds:
1Vote
in German:
1Stimme
Instead of just the number...
Cheers
Arnold
Please Log in or Create an account to join the conversation.
- Mr_Anonymous
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 92
9 years 7 months ago #131157
by Mr_Anonymous
Replied by Mr_Anonymous on topic Re: Rating Schema Snippet for K2 Articles
Not sure. Maybe the words 'Vote' and 'Stimme' are automatically added by google after the number? In that case, perhaps it might be useful to add a space after the voting count number in the meta tag.
Please Log in or Create an account to join the conversation.
- Seekat Seemonster
- Offline
- New Member
9 years 4 months ago #135412
by Seekat Seemonster
Replied by Seekat Seemonster on topic Re: Rating Schema Snippet for K2 Articles
Hi there
Thanks for the valuable input on star rating and rich snippets. I'm trying to do more or less what's being describe in your article. The only difference is, I would like to use K2's build-in star rating. I'm also very new to the coding used to call data from an item. I gathered that last bit of your coding would be to recall the data gathered and output it in rich snippet form.
- <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"> <?php echo $this->item->numOfvotes; ?> </div>
<!-- Section for Schema -->
<meta itemprop="bestRating" content="5">
<meta itemprop="ratingValue" content="<?php echo ($this->item->votingPercentage / 20); ?>">
<meta itemprop="ratingCount" content="<?php echo (str_replace(array('(', ')', 'Vote', ' '), '', $this->item->numOfvotes)); ?>">
What bits of code would I need to change to recall the star rating data already embedded in the item?
Also still struggling with JCE stripping bits of code like - ?php echo $this->item->id; ?
As well as <meta itemprop="bestRating" content="5"> which I have to change to the following for JCE not to strip <span itemprop="bestRating" content="5"></span>
Thanks for the valuable input on star rating and rich snippets. I'm trying to do more or less what's being describe in your article. The only difference is, I would like to use K2's build-in star rating. I'm also very new to the coding used to call data from an item. I gathered that last bit of your coding would be to recall the data gathered and output it in rich snippet form.
- <div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"> <?php echo $this->item->numOfvotes; ?> </div>
<!-- Section for Schema -->
<meta itemprop="bestRating" content="5">
<meta itemprop="ratingValue" content="<?php echo ($this->item->votingPercentage / 20); ?>">
<meta itemprop="ratingCount" content="<?php echo (str_replace(array('(', ')', 'Vote', ' '), '', $this->item->numOfvotes)); ?>">
What bits of code would I need to change to recall the star rating data already embedded in the item?
Also still struggling with JCE stripping bits of code like - ?php echo $this->item->id; ?
As well as <meta itemprop="bestRating" content="5"> which I have to change to the following for JCE not to strip <span itemprop="bestRating" content="5"></span>
Please Log in or Create an account to join the conversation.
- Mr_Anonymous
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 92
9 years 4 months ago #135418
by Mr_Anonymous
Replied by Mr_Anonymous on topic Rating Schema Snippet for K2 Articles
I havent tried adding microdata through JCE or other editors. I find its easier to add the microdata to the php files directly using Template override. That way I dont need to worry about editors stripping codes, etc...
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 4 months ago #135453
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Rating Schema Snippet for K2 Articles
I concur with Mr_Anonymous. The best way to achieve this is through template overrides.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.