I'm creating a contest and the new content type is called nfw_contest (National Family Week Contest). I'm attempting to disable vertical tabs for users when they are creating new content of this type. I found the following:
<?php
// Enable vertical tabs on a form.
$conf['vertical_tabs_forms']['my_form_id'] = TRUE;
// Disable vertical tabs on a form.
$conf['vertical_tabs_forms']['page_node_form'] = FALSE;
// Enable vertical tabs but be selective of which fieldsets are included. By default all fieldsets are tabified. To exclude certain fieldsets, use an array with the fieldset ids associated with FALSE values.
$conf['vertical_tabs_forms']['page_node_form'] = array('menu' => FALSE);
?>
and my question is related to the 'page_node_form' value stated above. I assumed that it would be the name of the content type 'nfw_contest' but this isn't working as expected. Here is the entry I made in the settings.php file.
/*
*
* Disable vertical tabs on a form.
* Disable vertical tabs on National Family Week contest entry
*/
$conf['vertical_tabs_forms']['nfw-contest'] = FALSE;
What format is it seeking here?
Comments
Comment #1
Dalma commentedSorry folks I figured it out myself.
In my case it should be
nfw_contest_node_form
Comment #2
PixelClever commentedThere is a way to disable vertical tabs on a per content-type basis without editing settings.php. It still requires php, but for cases where the settings.php file can't be edited it will still work (which was why I needed it). I made a short tutorial on how to do it here: http://pixelclever.com/how-turn-vertical-tabs-specific-content-type
Comment #3
francis55 commentedI tried adding
$conf['vertical_tabs_forms']['my_content_type_machine_name_form'] = FALSE;
into sites/default/settings.php
The vertical tabs were removed, but they were replaced by javascript open/close sections that look even more untidy (my theme is based on fusion).
As usual when giving up on trying to get Drupal to remove stuff and failing, I am now applying the good old CSS solution that may be less elegant but does work:
1) using firebug to find the css class or id of the div section to remove (here, the div has a class="vertical-tabs clear-block" ie 2 classes; we'll just use one)
2) use firebug again to find the id of the page where that section is to be removed. Here it has an id of pid-node-add-my-content-type-machine-name. (Specifying the page avoids having the rule fire on pages where it's not supposed to.)
3) adding the following to the css file of my theme:
body#pid-node-add-my-content-type-machine-name div.vertical-tabs
{display:none !important}
This means informs css to hide the offending section.
This also means that 1) the server has to load the section 2) the CSS has to hide it, which must slow things down, but what the heck, it works...
Comment #4
a.milkovskyYou can use the module Vertical Tabs Visibility.
Currently module is in sandbox.