Any suggestions would be welcome, as I've only just begun to create custom modules for Drupal.
For this particular project, I have many (about 12, and potentially as many as 20) drop-down lists that I need to maintain. I figure I can either create a new node type to keep all the options in, or create a separate non-node linked table to store them.
Typical operations on these drop-down lists would be to add, remove, reorder or merge the options on a particular list. Actions would also have the potential to be made retro-actively modifying any nodes that they may have been used in.
So, what would be better? To create a specific drop-down list module to handle these items, or just access these tables from various different node types using standardized db queries?
- Martin
Comments
CCK
Without knowing exactly what you are thinking, it is hard to say for sure, but I expect that what you are suggesting could be done with CCK (Content Construction Kit). In short, CCK would let you create each of your lists as a dropdown field, which you would be able to edit from the admin interface. Those fields can be put together to make a custom node which would include any or all of your lists. Fields can be used in more than one node definition, so you could have different nodes to show different combinations of fields.
Contemplate is the module you need to make it show up on the screen a little nicer than a standard form. Next step for you is to read all the CCK documentation and see if it will work for you.
http://drupal.org/handbook/modules/cck
Steve
--
http://etmeli.us/
Depends
I have been developing a custom module, and am enjoying it; however, there is a significant learning curve.
I would only do so again if the existing front end tools--cck,views, others cannot implement the functionality you need.
good luck,
t.
Thank you.
I'll be reading up on CCK tonight to see if it will do, however I'm on my way to creating a 6 module (by the time all the proper components are complete) application, so I'm not all that shy about coding something new. The only reason I'm even making new modules is that there is so much customization required, I just don't see how it will be possible otherwise.
Even if CCK will do for the short term, that will allow me to concentrate on the other more important aspects for now. At the very least it will be a good learning experience.
- Martin
hook_form_alter...
...is your friend for customizing functionality in forms, CCK or otherwise. It's easy to get the perception that you have to live with the standard CCK functionality, but that's not the case. You can programmatically add form functionality, logic, validation and look particular to your situation. The advantage of using CCK is that you get a lot of added functionality out of the box, such as being Views enabled etc.
A nice intro to Form API was the first Dojo lesson...