After about the tenth time one of my business persons asked me to modify the description associated with one of my modules form fields, I got to thinking that I might want to leverage form_alter to modify the titles, descriptions and add links to the help documentation for all modules. The strategy I was thinking of is to have hook_form_alter modify the fields based on help data stored in the database. If the user had privileges, they would see links to modify each field displayed on the form in a "wiki" like way. I'm emailing the dev list to ask. 1. Is this a good idea or a bad one given future forms/ internationalization directions? 2. Is someone else working on a similar issue in a different (or same) direction? About to try and code a prototype..... Dave
On 4/26/07, David Metzler <metzlerd@metzlerd.com> wrote:
After about the tenth time one of my business persons asked me to modify the description associated with one of my modules form fields, I got to thinking that I might want to leverage form_alter to modify the titles, descriptions and add links to the help documentation for all modules.
The strategy I was thinking of is to have hook_form_alter modify the fields based on help data stored in the database. If the user had privileges, they would see links to modify each field displayed on the form in a "wiki" like way.
I'm emailing the dev list to ask.
1. Is this a good idea or a bad one given future forms/ internationalization directions?
2. Is someone else working on a similar issue in a different (or same) direction?
About to try and code a prototype.....
See http://drupal.org/project/helptip If you have permission, you see an edit link. Expanding it to work directly as a link underneath forms is interesting. -- Boris Mann Office 604-682-2889 Skype borismann http://www.bryght.com
David Metzler wrote:
The strategy I was thinking of is to have hook_form_alter modify the fields based on help data stored in the database. If the user had privileges, they would see links to modify each field displayed on the form in a "wiki" like way. Unless it already exists in some form, a module that provided an admin interface to form_alter functionality in general might be handy... being able to hide fields, etc. without leaving the Drupal admin interface (and providing a birds-eye view of a site's form_alter customizations).
Mike
Unless it already exists in some form, a module that provided an admin interface to form_alter functionality in general might be handy... being able to hide fields, etc. without leaving the Drupal admin interface
Form Filter, http://drupal.org/project/formfilter, provides a UI for hiding fields. (They are passed as values, and hide only if they meet validation criteria.) It can also be used by developers to fetch altered versions of forms--feed in a form id and the fields you wish to have, and get a version of that form with only those fields visible, but the other fields passed as values. This is used in Active Edit module, part of Javascript Tools, to enable in place editing.
Ok this weekend, I coded up a new module and am ready to release/ commit it. I evaluated "help tips" and "form filter" but they seemed to be going in different directions, so I think I'm ready to commit a new module. Currently, this module is named formeditor, but before I commit, I thought I'd get some input on what to call it. The new module has the following functionality: * Adds header and footer markup fields to each form for providing additional docs. * Lets site administrator alter the text in any "#title", "#description" field on a form. * Lets site admins alter the '#value' attribute of any markup field on a form. Other ideas for names? Requests to merge this with another project (see aggregator discussion) :). Thanks, Dave On Apr 26, 2007, at 3:18 PM, David Metzler wrote:
After about the tenth time one of my business persons asked me to modify the description associated with one of my modules form fields, I got to thinking that I might want to leverage form_alter to modify the titles, descriptions and add links to the help documentation for all modules.
The strategy I was thinking of is to have hook_form_alter modify the fields based on help data stored in the database. If the user had privileges, they would see links to modify each field displayed on the form in a "wiki" like way.
I'm emailing the dev list to ask.
1. Is this a good idea or a bad one given future forms/ internationalization directions?
2. Is someone else working on a similar issue in a different (or same) direction?
About to try and code a prototype.....
Dave
David Metzler wrote:
Ok this weekend, I coded up a new module and am ready to release/commit it. I evaluated "help tips" and "form filter" but they seemed to be going in different directions, so I think I'm ready to commit a new module. Currently, this module is named formeditor, but before I commit, I thought I'd get some input on what to call it. "Formeditor" is kind of vague (and likely to get the module confused with others that are for building/editing forms). Maybe "formlabeller" or "formdefaults" as the tweaks this module does seem to focus on descriptive text and form defaults?
Mike Cantelon
participants (4)
-
Boris Mann -
David Metzler -
Mike Cantelon -
Nedjo Rogers