Expand my Community achievements bar.

SOLVED

How do I build an anonymous 'Like' Social component

Avatar

Level 2

Hi all, 

Any design directions/pointers on how to build a anonymous "like" kind of a component on CQ. I see that voting component does similar but requires authenticated user and also 1 vote per user. I have been looking at the code/design of these out-of-the-box social components but some directions from the group will be of great help.  One of the simple thought is to see if I can have a Like component whose POST increments a node property by 1 and displays the results, but the negative I see is to make this work on a multi-publisher.  Appreciate any thoughts/experiences.

Also if you know of any component available on the package share/other libraries which could potentially meet this use case?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 8

My advice would to model it after the rating component in the out of the box social media stuff. The only difference would be modifying it to account for there only being one score - instead of multiple. That will be the easiest way to get around the multi-publisher concerns. That rating component is already designed to work with multiple publishers. You will probably end up with a node in the repository for each like, but there isn't a good way to avoid that and still ensure your multiple publish instances don't step on each other. 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 8

My advice would to model it after the rating component in the out of the box social media stuff. The only difference would be modifying it to account for there only being one score - instead of multiple. That will be the easiest way to get around the multi-publisher concerns. That rating component is already designed to work with multiple publishers. You will probably end up with a node in the repository for each like, but there isn't a good way to avoid that and still ensure your multiple publish instances don't step on each other.