Instead of the comments how they are now, with the subject either being defined or getting it from the body, I would like to have the subject of the comments be auto numbered. Just like how replies are for the support issues for various things in drupal.

Just a quick example:
http://drupal.org/node/181005

Can this be set or should this be moved to feature request?

Comments

mrf’s picture

I have used Automatic Nodetitles to do this for pieces of content before, but I've never had to do it for comments.

Might be worth taking a look, with the ability to use different tokens to build titles it is a really powerful module.

GreenLED’s picture

I'm just guessing here -- but can't you just create a comment template -- like a .tpl.php file and then edit the title to be something like...

<H2><PHP PRINT $comment->nid; ?></H2>

Something like that -- I'm not sure on the variable by the way -- I'm just saying you might just do something simple like that.. In other words just grab the comment id and use that as a title.

t1s’s picture

That sounds logical to me, but I would have no idea how to go about doing something like that. I have yet to learn php and me playing with code may prove disastrous.

Thanks though

zeta ζ’s picture

I haven’t looked, but I would guess $comment->nid is the id of the node that the comment is attached to.

There is a variable $id available in node templates, but if it exists in comment templates, it isn’t documented. This should do the same – place in your comment.tpl.php

<?php
  static $id = 0;
  $id++;?>

...

<h2>#<?php print $id; ?> Numbered comment</h2>

Edit: I’ve just checked – there is an $id variable, so just print it, without the static bit. You might need some logic to avoid confusion when posting/editing comments.
___________________
It’s in the detaιls…

t1s’s picture

Got what i want.
But now I want to disable the title text field when submitting a comment to prevent confusion. What file do i need to modify for this?

mrf’s picture

You have the option to disable the comment subject on the comment settings page (admin/content/comment/settings), but that could possibly interfere with what you have done.

t1s’s picture

Doesn't look like 6 has the option to disable them. If it does, it's been put elsewhere. the only thing i can do in admin/content/comment is view published comments and an approval queue

mrf’s picture

Oh, right, looks like things have changed for 6, now each content type now has its own comment settings (where you can disable the subject). You can get to the different node pages from admin/content/types and selecting edit for the type you want to modify.

t1s’s picture

Thank you. I wouldn't have even thought to look there.

GreenLED’s picture

Sounds like the problem is solved -- good to hear.

» Respectfully, GreenLED
» Stable Files . net