Jump to content

Recommended Posts

Posted

Hello,

here is example from one of my projects and don't know if that can help you.

comments-foto-2.png.ef4f2c222db68157819c5942fdd2ac55.png

That example show AVG of 4.6, and below is copy/paste how I get that.

I believe that only what you need is to set "use stars", and this call:

$page->comments->renderStars(true, array('schema'=>'microdata','partials'=>true));

Or more details, where I use that:

<?php if($page->comments->count):?>
<div class="star-rating">
   <div class="rating-counter">
	   <a href="#listing-reviews">
	   <?php echo $page->comments->renderStars(true, array('schema'=>'microdata','partials'=>true));?>
	   </a>
   </div>
</div>
<?php endif;?>

If that is interesting, here is and Comments configuration to use Font Awesome icons.

CommentStars::setDefault('star', '<i class="fa fa-star"></i>'); //<= star item using fontawesome icon

Regards.

  • Like 4
  • Thanks 2
  • 6 months later...
Posted

Hello @OLSA Could you please explain where should I put the 

CommentStars::setDefault('star', '<i class="fa fa-star"></i>'); //<= star item using fontawesome icon

as this is my first time needing to replace the default stars with some FA icons and it would be a great addition to my learning curve ? I see the same info in the comments field details tab, however am not sure how to insert it properly to have the stars changed to else.

Posted

Hello @MilenKo

you need to do that somewhere before Comments module render methods calls ( renderStars() for page rating, and render() for user reviews ).

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...