Hello,

I'm stuck at writing a module for drupal 6.x.
I want to create a tabbed viewm like the page user management where we can see two buttons List and Add.
I need the same thing But I'm unable to find some help.

What I look for is a starter code that help me to understand how to make the tab appears then I will continue to do my module.

Thanks for help.

Comments

abdu’s picture

Create a hook_menu like below

  $items['mine'] = array(
    'title' => 'List',
    'access arguments' => ......,
    'page callback' => .....,
  );

  $items['mine/list'] = array(
    'title' => 'List',
    'access arguments' => ......,
    'page callback' => .....,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['mine/add'] = array(
    'title' => 'List',
    'access arguments' => ......,
    'page callback' => .....,
    'type' => MENU_LOCAL_TASK,
  );
jaypan’s picture

To add to this, the key point is in defining the menu element as either MENU_LOCAL_TASK or MENU_DEFAULT_LOCAL_TASK.

hook_menu()

Contact me to contract me for D7 -> D10/11 migrations.

luuna’s picture

Thanks to both of you.

I tested this and it worked.
I have ordered pro drupal development edition 2008, I think it will help me to solve such trivial programming problem :P.