drupal - Administration menu -


I am looking for some initial resources, which is for Doppl. I am writing my own module as a way to teach the fundamentals of development because I like the idea of ​​being scared when WordPress can not manage. (Although WordPress is fast becoming Drupal but there is no question about it.)

I have a module in the enabled / inactive screen and the module is shown in. The style file is a treatment work Does. What I'm stuck in is creating an admin area to edit entries in the table I'm using. My module_management_settings () function module is in admin.inc, module.module.module.main ().

But it is not visible in the menu and I am stumped because of it. So I hope someone knows a good tutorial that how to set up admin options.

If you want to become serious with Drupal development, I let you go through the book Will advise. This is the single most useful drop-up book I've read.

For your question, creating an administrator section is not very different from making some views what you have to do.

  1. Apply to register the URL you want to use, in your case admin / settings / name should be corrected
  2. Implement the call back function that a user should call when you visit. In your case, you do not need to apply it as you should, but instead you need to create a form that the user should see.

    You can get this information from your Hook_menu like this:

      function modulename_menu () {$ items = array (); $ Item ['admin / settings / modulename'] = array ('title' = & gt; 'menu item', 'description' = & gt; 'menu item description. Use it as title attribute and administration review 'Page', 'page callback' = & gt; 'drupal_get_form', 'page arguments' = & gt; array ('form_id'), 'access logic' => array ('module administration'), / / Access restriction only for the entry); Return $ item; }  
  3. Then you need to submit verification of handlers to the implementation and verification of your form, do you use it, you do a lot of work for yourself You can. / P>

  4. Whenever you make a change to hook_manu , you need to clear the drawer cache, because Drupal has this information to customize the display. Does.

That's it, you no longer need to use different files in your module. If the module is shorter then all can go to the .module file only, but for larger modules, you can put some code in .inc your code To organize a little bit. For your regular callbacks / functions, your admin callback / function, modulename.page.inc for Fx modulename.admin.inc


Comments