kk Star Ratings
[resolved] Adding Microdata information (4 posts)

  1. mishta
    Posted 3 years ago #

    I am trying to integrate into the code Microdata information.
    To do so I altered the original code of kk-star-ratings/kk-ratings.php by adding some info.

    public function markup($id=false)
    			$markup = '<div itemscope itemtype="http://data-vocabulary.org/Review-aggregate" class="kk-ratings open">
    						  <div class="stars-turned-on"> </div>
    						  <div class="hover-panel">
    							  <a href="javascript:void();" rel="star-1"></a>
    							  <a href="javascript:void();" rel="star-2"></a>
    							  <a href="javascript:void();" rel="star-3"></a>
    							  <a href="javascript:void();" rel="star-4"></a>
    							  <a href="javascript:void();" rel="star-5"></a>
    						  <div itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating" class="casting-desc">'.$this->options['init_msg'].'</div>
    						  <div class="casting-thanks">Thanks!</div>
    						  <div class="casting-error">AAn error occurred!</div>
    			$markup .= $this->options['clear']? '<br clear="both" />' : '';
    			return $markup;

    The resulted code in html page is:

    <div itemscope="" itemtype="http://data-vocabulary.org/Review-aggregate" class="kk-ratings" style="float: left; opacity: 1; ">
    						  <div class="stars-turned-on stars-turned-strict" style="display: block; width: 100%; "> </div>
    						  <div class="hover-panel">
    							  <a href="javascript:void();" rel="star-1" style="display: block; " class=""></a>
    							  <a href="javascript:void();" rel="star-2" style="display: block; " class=""></a>
    							  <a href="javascript:void();" rel="star-3" style="display: block; " class=""></a>
    							  <a href="javascript:void();" rel="star-4" style="display: block; " class=""></a>
    							  <a href="javascript:void();" rel="star-5" class="" style="display: block; "></a>
    						  <div itemprop="rating" itemscope="" itemtype="http://data-vocabulary.org/Rating" class="casting-desc" style="display: block; ">5/5 from 1 votes</div>
    						  <div class="casting-thanks" style="display: none; ">Thanks!</div>
    						  <div class="casting-error">An error occurred!</div>

    I need to add the rating markings. I do not know how to do that...
    I am sure this will lead to a new version of the plugin ....
    The code:
    <div itemprop="rating" itemscope="" itemtype="http://data-vocabulary.org/Rating" class="casting-desc" style="display: block; ">5/5 from 1 votes</div>

    needs to be changed to ...

    <div itemprop="rating" itemscope="" itemtype="http://data-vocabulary.org/Rating" class="casting-desc" style="display: block; "><span itemprop="average">5</span>/<span itemprop="best">5</span> from <span itemprop="votes">1</span> votes</div>


  2. Kamal Khan
    Plugin Author

    Posted 3 years ago #

    For your custom description (meta info) you can use jquery to handle this.

    I don't think this will be an appropriate option to have this in a new version.

  3. mishta
    Posted 3 years ago #

    I do not know if you are aware of the tendencies, but if take a look at Google Webmaster Tools you will see that Google have a testing tool for testing this: Rich Snippets Testing Tool.
    This means that Google encourages the use of this and I can reassure you that microdata is really working.
    All that I wrote above makes me believe that THIS HAS TO BE IN THE NEW VERSION!

  4. melissaaggie98@gmail.com
    Posted 2 years ago #

    I completely agree! Please put this in the new version, for GD Star Ratings already has this feature and it definitely helps drive traffic to your site from Google searches.

    GD Star Ratings is way too complicated though and doesn't work as well as your plugin does. If you were able to add this feature in a new version, yours would be the best option out there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • kk Star Ratings
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic