Copied to clipboard

Flag this post as spam?

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


  • Gert Peter Brigsted 30 posts 61 karma points
    Apr 17, 2011 @ 10:25
    Gert Peter Brigsted
    0

    Dislike comments

    I'm converting an old site to use Umbraco. It's a site with recipes, where you can add comments for each of the recipes. Members should be able to flag or dislike comments they find rude or irrelevant. If a comment has five or more dislikes, it should be hidden for all members. Is this possible with Umbraco? I would like the dislikes to be registered on the member, not as a counter on the actual comment.

  • Eran Meir 401 posts 543 karma points
    Apr 17, 2011 @ 10:33
    Eran Meir
    0

    sure it can do with umbraco, how did you implement the comments so far ?

  • Gert Peter Brigsted 30 posts 61 karma points
    Apr 17, 2011 @ 10:36
    Gert Peter Brigsted
    0

    Everything on the old site was handcoded in raw sql (for MySQL) and classic ASP. But there is no dislike-function on the existing site.

    Edit: Ahh, of course you mean on the new Umbraco site... :) The comments are just nodes (without templates) on the recipes. Subquestion; is there a better way to do it?

  • Eran Meir 401 posts 543 karma points
    Apr 17, 2011 @ 11:10
    Eran Meir
    0

    you can use your way, i saw someone implement it here http://our.umbraco.org/forum/developers/razor/18551-CommentsHow-to with razor.
    you can define on your document type of comment a property of number that will hold the number of dislikes.

    if you want to show the comments you can do something like this.

    @foreach(var item in Model.Children.Where("numOfDislikes < 5") 
    {
    }

    another option is to enable the "umbracoNaviHide" once the counter of numOfDislikes reaches 5 and then you can do 

    @foreach(var item in Model.Children.Where("Visible") { }

     

    and about changing the property on the frontend you can do it with the API, read more about it http://our.umbraco.org/wiki/reference/api-cheatsheet/modifying-document-properties
    hope that help you to get started.

  • Gert Peter Brigsted 30 posts 61 karma points
    Apr 17, 2011 @ 11:23
    Gert Peter Brigsted
    0

    Yes, I know how to do it this way, but as I wrote above, I would like the dislike to be registered on the member. The reason for this is so he/she cannot dislike it multiple times.

  • Eran Meir 401 posts 543 karma points
    Apr 17, 2011 @ 11:29
    Eran Meir
    0

    you can use relations for this thing, you can relate a "dislike" to comment and a member http://our.umbraco.org/wiki/reference/api-cheatsheet/relationtypes-and-relations 

  • Gert Peter Brigsted 30 posts 61 karma points
    Apr 17, 2011 @ 18:36
    Gert Peter Brigsted
    0

    Super, this looks exactly like the thing I need! :) However, I installed the package, and I get the following error every time I click the only relation there is:

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DUAL, NAME, ALIAS FROM UMBRACORELATIONTYPE WHERE ID = 1' at line 1

    Also, I cannot create any new relations. I'm running Umbraco 4.7. The documentation for the package also seems sparse, do you have any useful links?

  • Eran Meir 401 posts 543 karma points
    Apr 17, 2011 @ 19:37
    Eran Meir
    0

    i have no idea, you can use relations without the package, unfortunely there's no good documenation about it without umbraco.tv :\
    maybe someone know a good article for it?

  • Eran Meir 401 posts 543 karma points
    Apr 17, 2011 @ 19:40
  • Gert Peter Brigsted 30 posts 61 karma points
    Apr 18, 2011 @ 07:11
    Gert Peter Brigsted
    0

    Awesome, thank you! :) It's a shame Umbraco is so poorly documented. But the community, and especially the forums, make up for it! :)

Please Sign in or register to post replies

Write your reply to:

Draft