Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By AndyLicht on
Hi,
i want to use vertical tabs in a configuration form, i get my tabs in groups, but they are not shown in a sexy tab menu, only a groups together.
So i need some help or the right words i have to search for.
$form['advanced'] = array(
'#type' => 'vertical_tabs',
'#title' => t('Settings'),
);
$form['base'] = array(
'#type' => 'fieldset',
'#title' => t('Base Settings'),
'#group' => 'advanced',
);
$form['base']['basePath'] = array(
'#type' => 'textfield',
'#value' => $this->config->get('basePath'),
'#required' =>TRUE,
'#title' => t('Drupal Base Path of WeatherAPI'),
);
$form['rest'] = array(
'#type' => 'fieldset',
'#title' => t('REST Settings'),
'#group' => 'advanced',
);
$form['rest']['entityNodeGET'] = array(
'#type' => 'textfield',
'#value' => $this->config->get('entityNodeGET'),
'#required' =>TRUE,
'#title' => t('Drupal Base Path of GET'),
);
$form['database'] = array(
'#type' => 'fieldset',
'#title' => t('Database Settings'),
'#group' => 'advanced',
);
$form['database']['databaseHost']= array(
'#type' => 'textfield',
'#value' => $this->config->get('databaseHost'),
'#required' =>TRUE,
'#title' => t('Database HOST'),
);
$form['dwd'] = array(
'#type' => 'fieldset',
'#title' => t('DWD Settings'),
'#group' => 'advanced',
);
$form['dwd']['DWDNode'] = [
'#type' => 'textfield',
'#value' => $this->config->get('DWDNode'),
'#required' =>TRUE,
'#title' => t('DWD Node ID'),
];
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Save'),
];
return $form;
Thanks a lot
Andy
Comments
Hi Andy,
Hi Andy,
Instead of 'fieldset' you need to use 'details'. It would be something like this:
And so on with the rest...
Thanks a lot, now everything
Thanks a lot, now everything looks "sexy".
Woa !
Thank you