UP Computer Science Interns' Blog

May 28, 2010

ROTFL (Rolling Out the Forms and Links)

Filed under: web_200622582 — drew017 @ 7:03 pm
Tags: , ,
Again I have to search about creating a form in Drupal. At first I thought a module called Webform would be a solution. Though the module is great for making a form, I do not find it fit (assuming I have exploited all the features of the module) to exhibit the flow of the form structure (it has conditional branching). Finding no other means to work it out, I decided to write a module myself.
Writing a module in Drupal is not that easy for a beginner. You have to deal with functions that you will override like hook_node_info, hook_menu, and hook_form. You also deal with two basic files, a .info file that gives a description about the module and a .module one where you write most of the code. To access information from nodes (i.e. content in Drupal) you communicate with the database (remember CS 165). I have to write some tables in the database and edit the structure of one or two. Thanks to some code snippets from the Drupal site and from other members of the community about forms, I was able to craft a multistep form (though not clean enough to be published) which I guess satisfies the request of the client. I was not able to finish it in a day, though.

What I came up with...

Advertisements

Blog at WordPress.com.

%d bloggers like this: