Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How could I ad a "class" to the li of the first comment?
Hi,
I was wondering how could i ad a class to the div li , for just the first comment of every discussion?
wayne
0
This discussion has been closed.
Comments
Not tested, but copy themes/comments.php in your new theme folder, you'll find this line
$CommentList .= '<li id="Comment_'.$Comment->CommentID.'"'.($CommentClass == ''?'':' class="'.$CommentClass.'"').'>
around line 74. Then just add this line
if ( $RowNumber == 1 ) $CommentClass .= ' FirstComment';
BEFORE it.
Could you please tell us what is this for ?
I'm gonna try this out
ol#Comments li:first-child { /* your styles here */ }
Chronological
With Chronological, it stays on top as long as it's the latest discussion (by creation date not newest comments date).
By the way, I love your term "spaghetti code" it's much nicer than "hacker" :-)
Me, I also add meatballs to my spaghetti!
.($FirstRow?' FirstDiscussion':'')
to the serie of classes, right before.'">
Replace $FirstRow by
($FirstRow AND ForceIncomingInt("page", 0) < 2)
if you want only a FirstDiscussion class on the FIRST page of the discussion list.
(remember hacking themes)
Acting when creating a discussion only, this could help the writer of an article (or a bug reporter in our Issue Tracker).
With a simple javascript onload thing, the comment form could be pre-filled.
Each category could be assigned a template.