Page 1 of 1

Reference comments to their origin

Posted: Tue May 29, 2012 8:27 pm
by yellowled
When using threaded comments in a blog, it can get messy. Especially if a lot of comments are posted within a short period of time, the comment thread gets really cluttered. It becomes difficult to follow which comment refers to which comment.

In s9y blogs, we do have a point of reference: our comment form usually includes a select box – {$commentform_replyTo} –, which basically provides the ability to reply to another comment.

Is this value ("comment, to which this comment is a reply") still accessible for comments already posted? I.e., is there a smarty variable which I could use to reference comments to their origin? Or is this just a temporary construct to get the proper nesting level for threaded comments?

YL

Re: Reference comments to their origin

Posted: Wed May 30, 2012 8:59 pm
by onli
It's definitely part of the database and of the comment-structure. So there should be a variable, the code suggests it is comment.parent_id (we need a doku of such stuff! Is that part of the book?). I guess the fastest way to confirm that info is to print the content of the variable.

Re: Reference comments to their origin

Posted: Thu May 31, 2012 10:46 am
by yellowled
onli wrote:comment.parent_id (we need a doku of such stuff! Is that part of the book?)
Yay, that … well, I wouldn't say it works, but it holds the info I need to build something that works. :wink: Thanks.

According to the book, it should be $comment.X.parent_id. I'm sure it's also somewhere on s9y.org, but, frankly, asking here is just more convenient than searching the book. We should get that thing online asap.

YL