You are hereBlogs / dave's blog / Disable 'Preview Required' for Comments in Drupal 6

Disable 'Preview Required' for Comments in Drupal 6


By dave - Posted on 15 January 2009

By default, Drupal is configured to force anonymous users to preview their comments before posting them. To enable users to post without previewing their comment, you might think you'd access:

Administer > Content Management > Content Settings > Post Settings

Not anymore!

In Drupal 6, the comment preview settings are tied to each content type. Visit:

Administer > Content Management > Content Types at admin/content/types

Select 'edit' next to the content type. For the 'page' content type, you'll end up at:

admin/content/node-type/page

Scroll down to 'comment settings' and change 'preview comment' from Required to Optional. Then click 'Save content type.'

thanks ... this help me a lot

I knew I saw this somewhere. I thought I had lost my mind. :)

...had forgotten where i had seen this earlier, glad your page came up in google !

Same story as the above comments.
Drupal has a very confusing backend hierarchy.

This is probably my LEAST FAVORITE "feature" in Drupal 6. Instead of having one page that allows me to define how comments work all over my site I now have to set it in six different pages. There is such a thing as "too granular."

How can I disable the Preview button from appearing on the screen?

Thanks.

There are a few ways. Any one of these should work:

  1. The preview button uses the #edit-preview CSS ID. By setting this ID to display:none; in your CSS, you can effectively hide the preview button.
  2. Create a module that calls hook_form_alter() and removes the preview button, for example: unset($form['buttons']['preview']);
  3. Create a template file for the specific form you're trying to hide the button on. In that template file, insert the line $form['preview'] = null;

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Tags associated with this post

About dave

dave's picture

Name
Dave Nugent

Bio

Dave is a freelance Drupal developer working in the San Francisco bay area. He recently graduated from Carnegie Mellon University Silicon Valley. In his spare time he docents at the Computer History Museum. Follow Dave on Twitter @drnugent.