I have a content-type that has been created via hook_install. I want to set the "Preview" option to disabled. Currently it defaults to "optional". How can I change this in hook_install when I create the content type?
For programming disabling use special variable:
variable_set('node_preview_' . $content_type, '0');
For default node options "Published" (
status), "Promoted" (
promote), "Sticky" (
sticky) and "New revision" (
revision) use variable
"node_options_" . $content_type, which takes array as a value.
Example can be found in standard installation profile:
// Default "Basic page" to not be promoted and have comments disabled. variable_set('node_options_page', array('status'));
If you want more control over when the preview button is disabled you can use hook_form_alter() and then
Should give you the ability to enable and disable on the fly instead of setting globally.
Go to the Content Type in the Administration bar and click Edit on the content type you want to adjust. Then at the bottom under Submission Settings change "Preview before Submitting" to disabled.