Greg Sherwood Average Rating

Hi,


I'm trying to do the Greg Sherwood way of Average Rating customer reviews but can't get it to work.



I follow his tutorial by:


  1. Created Metadata Schema with text field, default set to 0


  2. Trigger - Event (Asset Created), Asset is of type (Comment), Calculate Average Comment Rating (Metadata text field) and Ignore Permissions and Non Critical ticked.





    When I try to create comment I get the following message


[quote]Trigger Action: trigger_action_calculate_average_comment_rating Failed, but was not required. Trigger continues. [CORE0134][/quote]



If I turn the trigger off, the asset gets created without any problem. Permission is read, write and admin all ticked.



Is there anything else I'm missing?

[quote]Hi,


I'm trying to do the Greg Sherwood way of Average Rating customer reviews but can't get it to work.



I follow his tutorial by:


  1. Created Metadata Schema with text field, default set to 0


  2. Trigger - Event (Asset Created), Asset is of type (Comment), Calculate Average Comment Rating (Metadata text field) and Ignore Permissions and Non Critical ticked.





    When I try to create comment I get the following message







    If I turn the trigger off, the asset gets created without any problem. Permission is read, write and admin all ticked.



    Is there anything else I'm missing?[/quote]







    Hi,



    Under "Calculate Average Comment Rating" Action, there are two fields that need to be populated namely "Metadata text field to store ratings average" and "Metadata text field to store total comments". Are u using two different metadata fields for each of them?



    Cheers ,



    Ash

When I use average metadata field I get the above error. If I use both then I don't get error but it does not calculate the average score. or show the total number of assets.


Am I meant to be using 2 different metadata fields?





Another way I can get it to work is by Calculating the Average with Jquery but I can't load the Average to another page dynamically as it gives me either %NaN or blank.



Maybe someone know how to load dynamically calculated content dynamically! (if it makes sense)







Thanks.


If you can get the values into the page, they can be calculated. Explain a little more so I can help you with the jQuery part.

[quote]When I use average metadata field I get the above error. If I use both then I don't get error but it does not calculate the average score. or show the total number of assets.


Am I meant to be using 2 different metadata fields?





Another way I can get it to work is by Calculating the Average with Jquery but I can't load the Average to another page dynamically as it gives me either %NaN or blank.



Maybe someone know how to load dynamically calculated content dynamically! (if it makes sense)







Thanks.[/quote]



You need to have 2 metadata fields:

1 for the total number of comments

2 for the average rating



This should sort out your problem



Dave

Ok, it is working but not in a way which I wanted to.


If I create the comment under Asset Listing Page, then I can calculate the Average Rating perfectly fine with the Parent Asset Listing.



But if I create it inside a Folder or Standard Page, I can't grab the Total Comments or Average with Asset Listing even thought the Values are inside the parent Folder / Standard Page metadata.




[quote]If you can get the values into the page, they can be calculated. Explain a little more so I can help you with the jQuery part.[/quote]

I can list all the comments with Asset Listing and calculate the average with Jquery without any problem.



Here is the JQuery

    	


Here is the HTML
    

<table id="average">	
<thead><tr><th>Comments Rating</a></th></tr></thead>
<tbody><tr><td>80</td></tr>
<tr><td>60</td></tr>
<tr><td>80</td></tr>
<tr><td>100</td></tr>
<tr><td>20</td></tr>
</tbody>
</table></pre><br />

The problem is when I try to dynamically load [b]only[/b] the Average Score from a div#total to another page it fails to show the calculated result.

This is basically how the total reviews will look in the front end.
[img]http://img218.imageshack.us/img218/3171/efh.png[/img]