Keyword

K2 Rating on Google

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #159825 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Rating on Google
Hello,

The correct parameter statement should be:
<?php if($this->item->params->get('itemRating')): ?>

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 4 months ago #159833 by Goble002
Replied by Goble002 on topic K2 Rating on Google
Thanks,

no errors now. However search.google.com/structured-data/testing-tool does not detect any structured data.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #159855 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Rating on Google
I will need a link in order to check this.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 4 months ago #159863 by Goble002
Replied by Goble002 on topic K2 Rating on Google
Hello Krikor,

The link: www.webs800.com/en/services/web-development/web-design-maintenance

I just noticed that I wrongly pasted the code last time which made me thought that were no more errors (sometimes errors seem to occur when you copy large amount of codes in template overrides).

Anyway with the code hereunder, it will just break the layout of my page. So I reverted back to the codes without microdata.
	<?php if($this->item->params->get('itemRating')): ?>
	<!-- Item Rating -->
	<div class="itemRatingBlock">
		<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
		<div class="itemRatingForm">
			<ul class="itemRatingList">
				<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
			</ul>
			<div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

With this code also Structured Data Testing Tool says: The review has no reviewed item specified.

So I have also tried with
<span itemprop="itemreviewed"><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
instead but no change

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #159891 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Rating on Google
Viewing www.webs800.com/en/services/web-development/web-design-maintenance 's source and I could not find any other structured data (itemprop).

There is an example here with more complete code, but only try the itemprop values not the PHP part.
github.com/kricore/Advanced-templating-with-K2/blob/master/default/item.php

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 4 months ago #159899 by Goble002
Replied by Goble002 on topic K2 Rating on Google
Hello Krikor and thanks,

like mentioned the code was breaking my layout so I had to remove it. I have made a copy of the website and use the code here:
www.webs800.com/webs801/en/services/web-development/web-design-maintenance

In the link you sent, there are no: itemprop="itemreviewed"
This is what is missing as per Google Structured Data Testing Tool

Thanks again for your help !

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #159918 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Rating on Google
It is not that simple, the ratings code belong to an object (structured data entity)
If the object is not defined, which in this case is the article, the rating code will not be picked up.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum