Re: [drupal-devel] Rewriting use of forms in Drupal
For example, my recipe module has a table in it. Each row of that table has 3 input fields in it. I dread to think what the code looks like to generate that with an array of controls.
I currently have no solution for this. As my proposal is now, you'd need to tell your theme what to do with the individual fields. An idea is to have form() (which would become theme_form()) call a "form layout" hook. Hmmmm.
I've discussed a bit with Adrian. I think the current solution would be to add simple form items to a form group in _nodeapi('form pre') and then in your theme do the table layout for that group.
The backdraw would be that all people would have to modify their themes to use your module.
Themers to the front: Can we avoid this?
Why not use a tableless css form layout that works without people needing to modify their theme, yet allows them to wrap it up in tables to display it another way if they so desire. e.g. in: http://www.quirksmode.org/css/forms.html http://www.cssdrive.com/index.php/examples/exampleitem/tableless_forms/ The label, form and fieldset tags could be fed to the theme separately, so by default the theme would just spit them out and they would be rendered reasonably by a snippet of css in drupal.css. If themers desire, however they can trap each/any tag and wrap them up in tables, spans, divs, or whatever they want. - Grug
participants (1)
-
Grugnog