Reference comments to their origin

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Reference comments to their origin

Post 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
onli
Regular
Posts: 2828
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Reference comments to their origin

Post 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.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Reference comments to their origin

Post 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
Post Reply