Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mike B 14 posts 57 karma points
    Dec 19, 2015 @ 15:34
    Mike B
    0

    Implementing a favorite/like system

    Hi guys, I'm looking to implement properly a favorite/like system where people can save content and people can see the amount of favorites each content has in umbraco.

    Normally this information would be saved in a new table with a composite key of { ContentID, MemberID } and maybe an extra BOOL field that could be used for dislike too.

    1. Is this possible to do in Umbraco? Or will I have to settle for server generated primary key and non-refferencing ContentID, MemberID?
    2. Would it be possible to attatch and access this info from IPublishedContent items? Need: A) total likes B) If current user has liked or not
    3. Should/could this info be indexed using ExamineManager?
    4. Would this be better to do by adding a custom property to a node then saving members that liked the content in a comma delimited fashion? IE: UsersWhoLiked = "1234,1235,1236" . If more than 50-100 people like each content this can get ugly pretty fast though..

    Thanks in advance for any help and guidance.

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Dec 19, 2015 @ 16:02
    Nik
    0

    Hi Mike,

    I'm not sure what the best approach would be exactly, but I definitely wouldn't do the last idea. The problem with the last idea is that each time a document is updated you would need to re-publish that page to make changes live. Each time this happens a new version of the document would be created and the cache would be updated. Just imagine how often this would be trying to happen if you had 50-100 people like each document and there were 100's of documents.

    I would probably look at keeping this in a separate database table which can be updated and read independently without having to run a publish event.

  • Jeffrey Schoemaker 408 posts 2138 karma points MVP 8x c-trib
    Dec 19, 2015 @ 16:51
  • Mike B 14 posts 57 karma points
    Dec 19, 2015 @ 18:35
    Mike B
    0

    Silly me! Thank you very much for the links...

Please Sign in or register to post replies

Write your reply to:

Draft