Last updated October 24, 2010. Created by LeeHunter on April 18, 2010.
Edited by arianek, Dinesh Rajput. Log in to edit this page.

To add fields to the comment form for a given content type:

  1. Navigate to the Content types administration page (Administer > Structure > Content types or http://example.com/admin/structure/types).
  2. Find the content type for which you'd like to add fields on the comment form, and click "Manage fields" next to it.
  3. Click the "Comment fields" tab.
  4. In the "Add new field" section, enter a human readable "Label" for the field.
  5. In the "Name" field, enter the machine name for the field. (You can only use numbers, lower-case letters, and underscores.)
  6. In the "Select a field type" dropdown list, select one of the following types:
    • Boolean
    • Decimal
    • File
    • Float
    • Image
    • Integer
    • List
    • List (numeric)
    • List (text)
    • Long text
    • Long text and summary
    • Term reference
    • Text
  7. In the "Widget" dropdown, select a widget. The options vary depending on the field type chosen.
  8. Click "Save".

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

You can go here to edit comment_body (the default comment field) and change it from "filtered html' to 'plain text' if you want to disable html/wysiwyg in comments.

Hi,
at the comments I want to have an additional field "Full Name". This field should be readonly and I want to fill in the Full Name another module saved as a global variable.

Anyone a tip how I can realize that? Maybe I just missed the documentation.
Thanks.

I solved the problem:

I added the field as a custom field.
then I made a new function in templates.php in my theme. There I called the form and altered the field to set the value (the full name) and to make it readonly.

It's probably not the best solution but it works fine for me.

How can I add imagefield to drupal forum post content typewich i think is comment, .. i think. thanks

Just want to display the name of the author of the comment. The form that viewers/visitors of my site fill out includes name, email, homepage, and comment (the default comment form). But when the comment displays it just displays the comment. I want to display all of the information that the viewers/visitors fill out (or at least their names).

I would like to avoid adding a new custom field as their is already an author field. There are already comments populated with authors' names.

If you want to replace the username with "Lastname Firstname" you can do something like this:

<?php
/**
* Implements hook_username_alter().
*/
function yourmodule_username_alter(&$name, $account) {
 
// Load user - we need it to get the firstname and lastname
 
$user = user_load($account->uid);
 
// Get firstname and lastname
 
$firstname = $user->field_profile_firstname[LANGUAGE_NONE][0]["value"];
 
$lastname = $user->field_profile_lastname[LANGUAGE_NONE][0]["value"];
 
// Change username
 
if ($firstname && $lastname) {
   
$name = $firstname . ' ' . $lastname;
  }
}
?>

Read more about this hook here