views:

247

answers:

1

I noticed, forms "story_node_form" or "node_form" are formed like this: form->div->div->div-standard+div-admin+submin-button

My custom content type is not formed this way:

Problems:

1) My created table is on the top of the form, how can i move it down?

2) How can i place my table into collapsable group?

3) Why submit and preview buttons are on the top of the form below my table?

+1  A: 

Because you rendered your table, then the rest of the form it is acting as expected, whereas if you where to place it in the $form array with the appropriate weight it would be rendered where it is expected with only the one drupal_render($form).

As for the collapsible group, you'd want to wrap your form elements in a collapsible fieldset, like so:

$form['wrapper-id'] = array(
  '#type' => 'fieldset',
  '#title' => t('title'),
  '#collapsible' => TRUE,
);
$form['wrapper-id']['yourstuff'] = array(
  // Your stuff
);

For more information about modifying forms, refer to the Form API documentation: http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6

Decipher
to place unrendered checkboxes into table i see only one way: prefix and suffix. What do you think about this comment: http://stackoverflow.com/questions/2312668/modificate-content-profile-form-to-show-checkboxes-in-the-matrixfirst, the idea was to use prefix and suffix, but then come another idea to render the elements into table.
EugenA
What I would do in that situation is build the form normally, grouping the checkboxes, then deal with the layout of them in your forms theme function. A good example of a checkbox heavy table would be the permissions page, so track down in the code how it's done there.
Decipher

related questions