I am not a programmer but reading the rating API documentation I think
that I've got the idea on how to set it up,
the only thing I cannot understand is how to use the $condition variable.
I have a type which has another type assigned for reviews,
so I disabled the parent type rating, and now on Sergey suggestion I need
to use rating API to display the number of votes and/or rating html in the records list and full view.
But for what is explained in the documentation the $condition variable
allow you to dispaly the rating for a certain user ID, record ID and so on...
now... how can I make this dynamic? I need one code that will work for all records of this section/type
not for only one user or one record
I think I am missing the technique to dinamically call the record (or user?) ID in the records list and full templates,
so that the ratng is properly displaied.
Right now if I use the code without the $condition variable in it, obviously the sum of all the records ratings is being displaied,
and it's not filtered per record
I also see this error
Warning: Missing argument 3 for CobaltApi::renderRating(), called in /home/alkemica/public_html/components/com_cobalt/views/record/tmpl/default_record_operatore.php on line 301 and defined in /home/alkemica/public_html/components/com_cobalt/api.php on line 34
which I do not know if it's due to the missing $condition variable in my code, or to something else
the code I am using when I see the above error is this one
<?php $rating = CobaltApi::renderRating(15, 6);?>
<div>
<?php echo $rating['html'] ?><br>
Voto: <?php echo $rating['total'] ?> su 100.<br>
<?php echo $rating['num'] ?> voti
</div>
thank you
I am not a programmer but reading the rating API documentation I think that I've got the idea on how to set it up, the only thing I cannot understand is how to use the $condition variable.
I have a type which has another type assigned for reviews, so I disabled the parent type rating, and now on Sergey suggestion I need to use rating API to display the number of votes and/or rating html in the records list and full view.
But for what is explained in the documentation the $condition variable allow you to dispaly the rating for a certain user ID, record ID and so on...
now... how can I make this dynamic? I need one code that will work for all records of this section/type not for only one user or one record
I think I am missing the technique to dinamically call the record (or user?) ID in the records list and full templates, so that the ratng is properly displaied.
Right now if I use the code without the $condition variable in it, obviously the sum of all the records ratings is being displaied, and it's not filtered per record
I also see this error
which I do not know if it's due to the missing $condition variable in my code, or to something else
the code I am using when I see the above error is this one
thank you