Has anyone else wanted to do this? If so, do you want to
- disable all preview buttons for forms everywhere?
- disable preview buttons for nodes but not for comments, or vice versa?
- disable preview buttons per content type?
- disable preview buttons by user role?
- disable preview buttons per user-chosen settings?
- have all of the above and do you have any idea what you are asking for in terms of admin user interface?
The initial version of this feature was sponsored by Digital Deployment and was referred to internally at Agaric as the form_tweak module, once we pulled it out of relativity_access.
benjamin, Agaric Design Collective
Comments
Comment #1
lozzagmk commentedI wish I could disable the Preview buttons on all kinds of posts and comments.
When users can reedit their posts, there's no point in adding the complication of a preview as it just confuses and lets people think they've posted when they haven't!
I'm having to say don't press Preview, when I don' even want it to be there!
Comment #2
mlncn commentedHi lozzagmk!
I've actually had a better look at how Utility does things now, and I honestly don't fully get it. When I posted this I thought Utility was simply a place to collect useful pieces that didn't make sense as their own module, but it actually uses it's own plugin or hooks system which is probably brilliant but beyond my understanding its point.
You can download the form tweak module (further tweaked to disable delete) here:
http://agaricdesign.com/note/disable-delete-regular-users
There is no user interface, but the code (being just a form_alter hook) is very short and has variables that can be edited to have different effects.
If you open up form_tweak.module you can see this, which will be the variables you're interested in changing:
So in short I'd be happy to make form_tweak its own Drupal project, if there's interest, unless someone can explain / convince me it's better in Utility after all.
benjamin, Agaric Design Collective
Comment #3
francewhoaAnother option is hiding PREVIEW button with Cascading Style Sheet (css).
Requirements: Drupal 6.x, Zen theme, CCK content type page.
Hiding all PREVIEW buttons on all pages. Add the following to your theme .css file:
Hiding PREVIEW button for one specific page. Add the following to your theme .css file:
Replace 'this-is-an-example' with your page BODY tag class. Usually it's the last item or the before last item.
<body class="not-front not-logged-in page-node no-sidebars page-node-example lorem-ipsum">Comment #4
litwol commentedIt is very difficult to predict which form button handles "previewing". especially when you're dealing with forms that often get altered or custom forms.
I think there is not enough consistency that we can rely on. i have to mark this a wont-fix and give responsibility to turn preview off to themers.
of course unless some one provides a working patch.
Comment #5
nancydruThe Form Tweak module was released, so changing this to duplicate since I occasionally review "won't fix" to see if I've changed my mind.
Comment #6
cmav77 commentedFor a walk-through on how to turn off the Preview button yourself in Drupal 6, you can check out this article. This is how I solved the issue using hook_form_alter. I hope it's useful for someone!
Comment #7
nancydru@cmav77: I like this idea, if you haven't already, please open a new feature request. I may be getting RealLife™ under control soon.