HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Nested comments

Is there are any solutions to get a nested structure for comments? At least one level? Any ideas, please tell me. Or maybe some other thing which will allow somehow

Comments

  • As for ideas, I can share some.

    I have come to dread multi threaded comments; things get so derailed it is unbelievable, like those dolls with inserts upon inserts.

    But one-level threading, I can totally appreciate.

    Some popular platforms address the presentation very peculiarly these days: think Flarum, Discourse and NodeBB - all being pure JavaScript! NodeBB via server-side, will tell you that this post has this number of replies (even if you disable JavaScript in your browser).

    Enter Vanilla Forums.

    A solution to achieve something similar is to have a reply button on every comment. When a user comments using such a button, a special parent marker is added to the user's comment.

    Two ways this marker could exist.

    1. Be in a special column in the comment database table gdn_CommentParent
    2. Be part of the comment body.

    In #1, you can do some very sweet things server side. List all the replies to this one comment (JavaScript not needed)... spit the result anywhere you want. And this relation of comment to other comment as child to parent can be made absolutely uneditable by the author of the reply.

    In #2, you can have the name of author of the comment that is being replied to, stored right in the message body. Of course not as a mention e.g

    <a class="threaded PostReply" href="#linkToTheParentCommentID">adminGuy</a>
    <p>Hello adminGuy, thanks for that comment. It really enlightened me. I registered just to say thank you. Have a blessed day.</p>
    

    Or use a special tag that you will replace server-side with all the magical things you'd need in the front-end (client-side). With just commentParentID you replicate all the info above.

    [[commentParentID=23]]
    <p>Hello adminGuy, thanks for that comment. It really enlightened me. I registered just to say thank you. Have a blessed day.</p>
    

    Only caveat to this #2 is that author can easily change the reply marker... well no big deal in some cases..... :)


    Enter JavaScript

    Let the visitor's browser do all the work. See Flarum for inspiration on what beautiful things you can do with that simple PostReply marker.

    One could almost tell I have been working on something quite similar ... hehehe

  • I can feel it is could be a hard work to do. I mean, personally, it can be difficult when Vanilla updates comes, will be conflicts. I think such feature should be simple as much it's possible. Let's see.

  • Yea, the plugin must (shall) be very topical. Very independent from the Vanilla core and non interfering in any way.

  • stondestonde New
    edited July 2020

    Thank you for the solution, donshakespeare. You could narrate one hell of a course on front-end development.

  • R_JR_J Ex-Fanboy Munich Admin

    FYI I believe that stonde guy is a spammer, but since I'm not sure I simply removed that suspicious link from his post

    Time will tell

Sign In or Register to comment.