Expand my Community achievements bar.

SOLVED

AEM6: social reviews - How to display the product average Rating of the users?

Avatar

Level 2

I use the AEM 6.0 social reviews to give the users the possibility to review some product. This component works fine. Now I would like to display the average Rating of all users for the reviewed product, sothat the user can see the overall user review of this product? Is there any component which do that or I have to do that programmatically?

1 Accepted Solution

Avatar

Correct answer by
Level 9

To overlay a component, look at Client-side Customizaton and the Overlay tutorial.

If you overlay reviews by copying to /apps/social/reviews/components/hbs/reviews (same path as /libs, but in /apps instead), then you do not need to go into design mode and change the resource type.

Relative resources are first looked for in /apps, and if not found, are looked for in /libs.  Thus, when customizing a resource, you can leave most of the functionality in /libs and only copy customized resources into apps.

The only time you might go into design mode to edit the component's resourceType is when a new extended component has been created and you want to switch an existing placed component to the newly customized one.  And, as described in the Changing to a Custom Review Type section, it is suggested to still use relative paths (do not include either "/libs/" or "/apps/").

Since your screenshot suggests an overlay, I would guess your problem might be that you need to use CRX|DE lite to modify the properties of /apps/social/reviews/components/hbs/reviews and /apps/social/reviews/components/hbs/reviews/review in a manner similar to the Overlay tutorial shown for the Comments component.

 /apps/social/reviews/components/hbs/reviews

     sling:resourceSuperType  social/commons/components/hbs/comments

     sling:resourceType  social/reviews/components/hbs/reviews

  /apps/social/reviews/components/hbs/reviews/review

      sling:resourceSuperType  social/commons/components/hbs/comments/comment

      sling:resourceType  social/reviews/components/hbs/reviews/review

 

I hope this helps.

- JK Kendall

View solution in original post

6 Replies

Avatar

Employee

You can use the "Review Summary" component which will show you exactly what you are asking for, each rating averaged of all users who have answered. You configure it by editing the component using the author and point the "Review Path" to where the reviews component you want a summary for.

Avatar

Level 10

Not out of the box. You need to custom implementation.

Avatar

Level 2

Thank you for your answer.

 

I have changed my author to design mode and then -> reviews edit -> Reviewsresource (see screenshot). Is that the right path? I tried both paths  /apps/social/reviews/components/hbs/reviews and /apps/social/reviews/components/hbs/summary but could not notise any changes :( 

Avatar

Level 9

If you look further down on the page you referenced, you will see the description of the Review Summary component.  The review and review summary can be (and likely are) on different pages.

Avatar

Correct answer by
Level 9

To overlay a component, look at Client-side Customizaton and the Overlay tutorial.

If you overlay reviews by copying to /apps/social/reviews/components/hbs/reviews (same path as /libs, but in /apps instead), then you do not need to go into design mode and change the resource type.

Relative resources are first looked for in /apps, and if not found, are looked for in /libs.  Thus, when customizing a resource, you can leave most of the functionality in /libs and only copy customized resources into apps.

The only time you might go into design mode to edit the component's resourceType is when a new extended component has been created and you want to switch an existing placed component to the newly customized one.  And, as described in the Changing to a Custom Review Type section, it is suggested to still use relative paths (do not include either "/libs/" or "/apps/").

Since your screenshot suggests an overlay, I would guess your problem might be that you need to use CRX|DE lite to modify the properties of /apps/social/reviews/components/hbs/reviews and /apps/social/reviews/components/hbs/reviews/review in a manner similar to the Overlay tutorial shown for the Comments component.

 /apps/social/reviews/components/hbs/reviews

     sling:resourceSuperType  social/commons/components/hbs/comments

     sling:resourceType  social/reviews/components/hbs/reviews

  /apps/social/reviews/components/hbs/reviews/review

      sling:resourceSuperType  social/commons/components/hbs/comments/comment

      sling:resourceType  social/reviews/components/hbs/reviews/review

 

I hope this helps.

- JK Kendall

Avatar

Level 9

(Notice that the super type for reviews is comments.)