[themes] Howto: table with surrounding fieldset

Stefan Borchert stefan at borchert.cc
Sun Oct 22 10:24:18 UTC 2006


Hi.
For my module settings page I would like to build up a table of 
available extensions (don't care about, just think of a simple table) 
but this table should be within a fieldset (collapsible).
[code]
    $form['ext'] = array('#type' => 'fieldset',
        '#collapsible' => true,
        '#collapsed' => true,
        '#tree' => true,
        '#title' => t('Extensions'));

    // build extension table
  foreach ($extensions as $key => $extension) {
    $form['ext'][$key]['status'] = array('#type' => 'checkbox', 
'#default_value' => $extension['status']);
    $form['ext'][$key]['weight'] = array('#type' => 'weight', 
'#default_value' => $extension['weight']);
    $form['ext'][$key]['title'] = array('#value' => $extension['title']);
  }
[/code]
There can be other form elements above and below of this fieldset (for 
example the submit button.
How do I handle this?
I can build the table and can build the fieldset but the table doesn't 
want to appear within the fieldset.

Any ideas (or a handbook page)?


Stefan


More information about the themes mailing list