what's the difference between MENU_DEFAULT_LOCAL_TASK with MENU_DEFAULT_LOCAL_TASK ?

Comments

naveenpl’s picture

What do u mean???
Please clarify your question.

Cheers

rmanola’s picture

I guess the question is: What's the difference between "MENU_DEFAULT_LOCAL_TASK" and "MENU_LOCAL_TASK".

In the menu_hook, if you define more than one link with the same prefix stating as "MENU_LOCAL_TASK" there should appear tabs, the link you define with "MENU_DEFAULT_LOCAL_TASK" is the one that's going to be selected when you first visit the prefix link, an example:

...

$items[] = array(
	'path' => 'names',
	'title' => 'Names avaliable',
	'callback' => 'names_func',
	'type'=> MENU_CALLBACK,
	);
	
$items[] = array(
	'path' => 'names/add',
	'title' => 'Add Name',
	'callback' => 'names_add',
	'type'=> MENU_LOCAL_TASK,
	);
	
$items[] = array(
	'path' => 'names/list',
	'title' => 'List Names',
	'callback' => 'names_list',
	'type'=> MENU_DEFAULT_LOCAL_TASK,
	);
	
...

When you visit "site_path/names", you'll see two tabs: "list" and "add", the "list" tab will be selected by default.

naveenpl’s picture

Here you have given 3 links.
name/, name/add/ and name/list/.
you can even declare more option.
here by giving MENU_DEFAULT_LOCAL_TASK to the path name/list, you are setting as the default menu.
Ie when you click the link for name/, the drupal will call the list function(setting list as default option).

solobigfish’s picture

it is what i want to

iamsuriyan’s picture

thanks!