Following up from the BOF at DrupalCon SFO...
I have a client that asks me for occasional one-off work on their Drupal site. They needed a registration form. No problem: build a node type in CCK and off ya' go. Six months later, then needed a very similar registration form. OK, I don't want to create a nearly-identical content type, so I'll add new fields to the old form and use hook_form_alter to hide them when accessed from the old URL. Three months later, another registration form was needed -- mostly the same fields, but a couple of new ones. More hook_form_alter() tweaks... You get the idea.
It occurred to me that this is very much like registration forms for sports. In general, league forms have all the same fields, but occasionally there's an extra field or two because it's a winter/summer/youth/adult/team/individual event. And you don't want to create new content type for each unique event. Along those lines I wrote a module I'm calling Registration -- perhaps it's not the best name, I'm open to suggestions.
The basic concept: limit the fields available on a given node entry/edit form based on a taxonomy term.
- There is one master content type associated with the Registration module which contains ALL the possible fields you would use to create a registration
- There is a vocabulary associated with the Registration module. Terms in this vocab can be used to create custom registration forms (one per term).
- For each registration form, you select which fields you'd like to appear on that form
- We can add additional options, though currently I only have enable/disable registration and specify the path to create this type of registration.
- Node creation happens as if this were yet-another-content-type
Since these are nodes, they benefit from all the love that nodes usually get in Drupal: Views, Nodequeues, etc.
What do folks think of this concept? Did I reinvent the wheel? (I couldn't find anything else that did something similar...)
Since this is very preliminary, I didn't want to post it to drupal.org. So, you can download the current incarnation from my site.
Any and all feedback is appreciated.