« first day (84 days earlier)      last day (5018 days later) » 

00:03
Yummy! Bolognese.
 
11 hours later…
10:58
hi all
can anyone tell me how to create forms in drupal ?
 
2 hours later…
13:21
@kiamlaluno ok, thanks
the basic question is where i have to put that form code in drupal ?
good
the second link seems not that useful
The function is defined as menu callback from the following code:
`$items['admin/appearance/settings'] = array(`
` 'title' => 'Settings',`
` 'description' => 'Configure default and theme specific settings.',`
` 'page callback' => 'drupal_get_form',`
` 'page arguments' => array('system_theme_settings'),`
` 'access arguments' => array('administer themes'),`
` 'type' => MENU_LOCAL_TASK,`
` 'file' => 'system.admin.inc',`
` 'weight' => 20,`
`);`
ok, so in which file i have to put this code ?
Great; back-ticks don't work, here.
@dskanth You put it in a module file, as you do in Drupal 6.
That snippet is in an implementation of hook_menu().
13:35
ok, thanks for ur suggestions...
great help
I think drupal_get_form would be the best suitable for me
i am confused with the answers here:
0
Q: Administrator users can add records, end users can view them.

dskanthHow can the administrator users add few records into the database (through a form), and how can the end users view them in the front end? Administrator users will be adding records of training classes, through a form in an administration panel. The end user will be viewing the list of training ...

can u discuss about this problem of myne
Only the admin can add the records
and the end user must be able to view the list in front end
how can i go about this...
I have created a form with the form api, but confused with how to link to it from the admin interface
?
13:51
@dskanth What do you mean by "admin interface"?
i mean admin panel (after the admin logs in)
admin should have a link to a form, where he will enter values in 3 to 4 fields and create the record (insert into database)
There are many paths you can use; admin/structure/your_module, admin/config/your_module, or admin/your_module. The path doesn't define what is an administrative setting page.
It's the permission associated with a menu callback that defines who can see that page.
The documentation for hook_menu() explains how to define a menu callback.
system_menu() is an example of implementation of hook_menu().
That is essentially what I am saying in the answer I gave to your question.
Thank you but i could not get you completely... do i need any coding changes, or everything is with the interface...
14:07
@dskanth You need to create a module.
yes i have created a module
and i tried to include a form in corresponding .module file
@dskanth Did you define a menu callback? Did you define a form builder?
no.... i dont know about that
Did you add a .info file for the module?
@dskanth That is why I reported the link for the hook_menu() documentation. The other link I reported is about the form API, which is the API used to build forms in Drupal.
14:22
@dskanth If you don't understand how to write the code, you can look at Drupal core code. That is how I learned how to create a module with Drupal, apart from reading the documentation.
Drupal comes with many modules you can use as guideline to write your own code.
@kiamlaluno Thanks a lot
@dskanth Yvw.

« first day (84 days earlier)      last day (5018 days later) »