Even though the URL param reads "?q=cases/details/26", arg(0) equals "cases" but arg(1) and arg(2) are empty.

What could be the problem?

Thanks.

Comments

johnhanley’s picture

BTW, $_GET['q'] equals "cases" only.

Alison@deanspace.org’s picture

and the function name?

johnhanley’s picture

...since my original post.

The function is called cases_detail().

The menu items[] definition looks like this:

$items[] = array('path' => 'cases/detail', 'title' => t('Case Details'), 'callback' => 'cases_detail', 'access' => user_access('edit case'), 'type' => MENU_CALLBACK);
Alison@deanspace.org’s picture

getting rid of the type parameter. That one isn't well documented and is a particular thorn in my side. Taking it out won't cause an additional problem cause I never use it. You can turn it off and on under administer>menu if you need to.

johnhanley’s picture

... that the "type" parameter wasn't the problem.

It seems the menu hook didn't like my choice of callback function names. I managed to get the callback function by using the "_page" suffix. This also solved my arg() parameter value problem. Cool, but now there's a new issue. Using the "_page" suffix in my function name unwantingly creates a new itme in my navigation tree.

My new question: how do you create a callback function to display a page of content without adding a nav item? Should I use one callback function with a conditional statement to call the appropriate sub function?

Thanks.

Alison@deanspace.org’s picture

Drupal doc is unintelligible on it as always.

My recommendation is to go to administer > menu and manually delete it.

johnhanley’s picture

I'll keep playing with hook_menu and report back.