Drupal, Remove Preview Button

Q: How can I completly remove the 'Preview Button' from (some or) all of my node type and associated comment forms in Drupal 6?

A: Use the Jammer module and configure it to remove the preview button from the desired node types.

Man oh Man, I am starting to think that this Blog should be renamed to the 'Remove from Drupal' blog as most of my posts seem to deal with how to remove something or other from the default drupal setup that doesn't fit with either your web design or client's brief! I think that it's partly due to the fact that we are currently working with a client with very minimalist leanings when it comes to the web - and that's no bad thing!

Well, here's another one - there are loads of scraps of information out there on the forums and the like on how to obliterate the 'Preview' button - with plenty of confusion and snippets of half working code etc!! The good news is that we can ignore all of this and just install the Jammer module instead - it does a great job of removing that Preview button!

Install the module and then go to its settings page (/admin/settings/jammer). In the 'Buttons' settings section, choose the node types from which you want to remove the preview button and then hit the 'Save configuration' button.

I hope this saves somebody searching for hours to find out how to do this (like I did!)

PS Jammer also has an option for switching off the 'Revision Information' text stuff from node forms so it provides another angle to one of my earlier posts on this subject.

Stranger
Stranger's picture
Didn't work

I just tried to use the Jammer module.

It has an option to disable preview for content types...but not for comments.

I am using the latest version: 6.x-1.1 2009-Jun-10

Joined: 08/01/2009
User offline. Last seen 3 weeks 4 days ago.
Hi, Even though it doesn't

Hi, Even though it doesn't have an option for comments it removes the preview button from my comment forms all the same, I trippled checked this just to make sure, i.e. I checked that another module wasn't removing the comment preview button instead and it was the Jammer (nearly 100% sure).... Did you try clearing the cache etc? Also you may have to goto the content types in question and make sure that a comment preview isn't required.

I had previously written a very small module that just removes the comment form preview button from everything - I could send you if you would like to try it instead...

Stranger
Stranger's picture
Another way

Another quick way to remove the preview button on the comment form via hook_form_alter:

function resynthesize_form_alter(&$form, $form_state, $form_id) {
if ($form['#id'] = 'comment-form') {
unset($form['preview']);
}
}

Stranger
Stranger's picture
Thank you very much for the

Thank you very much for the excellent and useful post.

Stranger
Stranger's picture
Elegant way - Remove the preview button on comments

Here is the solution:

http://drupal.org/node/57842#comment-998037

Sorry for my poor english ;)
Bye!

Joined: 10/10/2008
User offline. Last seen 1 week 3 days ago.
Thanks stranger, looks good!

Thanks stranger, looks good!

-----------------------------------------------

Award Winning Web Design Cork : Pride Web Design Cork

-----------------------------------------------

Stranger
Stranger's picture
works for me

removed preview button from comment box. sick.

Post new comment

  • 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.
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

Pride on FacebookPride on TwitterPride on TwitterPride on Twitter

Join Our Newsletter

* indicates required

Irish Internet Association

finalist.png
phone-number.png