Node and Comments Form Settings

I cannot longer mantain this module. I'm really sorry, but I've tried making time to maintain this one but there's always something urgent that prevents me from doing it. Co-maintainers are also welcome.

I often find myself doing the same hook_form_alter just to do the same things over and over again. It's just a waste of time. This module lets you change several 'small' behaviors with hook_form_alter, in both nodes and comments, doing it per content type so you can configure different aspects of your nodes/comments.

Currently you can do the following changes for nodes:

  • Hide the "Split summary at cursor" button
  • Hide the Input Format fieldset
  • Change the default value of the Submit button
  • Hide the preview button
  • Hide the node title, useful when you're showing the node title on the breadcrumb or if you want to hide it for any other reason. The title needs to be set, if you want to auto generate it, use Automatic Nodetitles since this will not hide the title on the form, just when viewing the node.
  • Show a 'Cancel' link on node edit form. Ported from http://drupal.org/node/116939
  • Option to remove revision log field. Thanks to @jjeff
  • Support for Vertical Tabs
  • A new module, CCK Form Settings, to disable the input filter of Text Areas
  • Now it works with Content Profile and Advanced Profile Kit
  • Added feature to control the size of the body textarea field and even change it to a textfield. Thanks to @ositoblanco for this

For the comments you can change the following:

  • Hide the author of the comment on the comment form
  • Hide the preview button
  • Hide the word 'Comment' or title
  • Hide the Input Format fieldset
  • Change the default value of the Submit button to whatever you like
  • Change the size of the comment text area
  • Option to disable the Name, Email and Homepage on Anonymous Comments

The easiest example I can realize of what this module does, is when you add a new comment, the submit button will say something like "Send", with this module you can easily change it to something more appropriate like "Publish comment".

If you find yourself doing some hook_form_alter just to change small behaviors of Drupal and you wish to stop doing it, please open an issue and propose a new hook_form_alter, just remember it has to be for something Drupal does, not a module. This is just a time saver module.

IMPORTANT ANNOUNCEMENT ABOUT 6.x-2.x
The 6.x-2.x branch is almost ready and you can start testing the beta, there are no bugs left to fix but I will add some other features before the stable release.

The main change is that the 6.x-2.x will make a less intense use of the variable table by storing all settings in just one variable per content type.

UPGRADING FROM 6.x-1.x

If you're upgrading, chances are you have all your content types configured. I added a new module to handle the migration, you should install it after you update your files.

The main reason for the migration module is because NFS and CFS have been separated into 2 different modules and now instead of creating several variables they use one per content type (nodeformsettings_content_type and commentformsettings_content_type) so your old variables won't work.

You can see a list of some of the changes made visiting http://drupal.org/node/1077760

The migration module will recreate the variables for you, but I must warn you that you should review this since your configuration could be lost. Please make a backup of your database before you do anything. To use the new Features bundled with 6.x-2.x you'll still have to edit your content type.

Recommended module: Chaos Tools

About contributing patches

NFS and CFS have been rewritten almost from zero. Now it is cleaner safer and easier to add new features since most changes are in separated files. The process now to add a new feature is:

  1. Define a new key and a default value in nodeformsettings_elements_default()
  2. Modify settings_node.inc to alter the configuration form
  3. Create a file in the includes directory in the form of _option_nfs_something.inc
  4. Create a file in the includes directory in the form of _option_nfs_something.inc
  5. Create the function that performs the change
  6. If the field could conflict with other Drupal setting, add a validation by adding the key to nodeformsettings_elements_validate()
  7. Create a file for the validation function
  8. Add the validation function

You can read more about the process by going to http://drupalcode.org/project/nodeformsettings.git/blob_plain/refs/heads...

Drupal 7

D7 already fixes some of the issues this module fixes in D6 but not all of them. The port is almost ready, but I need you to help testing it. If you find any bugs please create an issue.

Project Information

Downloads