As part of a web site project I need to create a web application to store and retrieve data from user input. I have explored the Drupal toolbox and am now familiar with many of the tools but not how to build the house!
I do not want to enable php in nodes if I can avoid it. I can create and access multi page forms in a module. I can create a block that contains a form in a module. I can create a node in a module.
The question is should I write a module that creates a node with my add/edit/delete forms created in that module. Or should I create a block containing the form and write another module with a node type that contains the block (that seems wrong). Or should I just create the form as a module and link directly to the form url.
Or is there a simple architecture that everybody knows except me!
I created such apps in php and javascipt generated HTML and CSS with mySQL as the DB. I just can't find a good architecture prototype within the Drupal framework or see an obvious "correct" way to do it.
Any help appreciated. I will continue my research and prototyping. This is my first expedition into serious Drupal development.
Comments
There is no need to create
There is no need to create nodes for what you want.
It is not even clear you need a module as content type(s) may provide what you need but you do not state the purpose of the forms.
From code you need to use the Form API (sounds like you figured out how to do that) which can be presented in a block (sounds like you have done that) and/or on a page using a menu callback defined in hook_menu(). hook_menu() is also typically used for defining paths and their callbacks to allow editing and deleting in addition to adding.
Architecure is not Post Installation it's about coding standards
If I create a content type I then use that to create nodes. I think. But I am finding Drupal terms difficult to tie down.
I do not want to enable php on any content as I am told this is a security risk. Also I want all configuration in code for maintenance purposes. Perhaps this goes against most implementations of Drupal.
I am very surprised this got moved to "Post Installation" as it is an architecture question. That is, about how to structure code.
Post installation is about things that don't work! But I stand to be corrected.
As for stating the purpose of the forms I said it is to add/modify/delete records in a relational database.
As an old fashion architect I always want to separate data from configuration so I do not want my user created data in the Drupal database tables that hold the Drupal configuration.
Is this the correct direction
Looking back into the Drupal configuration. I have created a content type and can add a block into that content types content.
That block can include my form and I can create that from a module. So no php on the page content.
The odd thing to me is then I will only create one instance of my new content type and prevent anyone creating another. This seems a misuse of "content types" but is it the correct direction?