rlb.usa
rlb.usa

Reputation: 15043

hook_menu Title

I'm having some trouble with the titles of my pages.

English Settings Page :

Title

 $items['mymodule/admin'] = array(
    'title' => 'Administrate',
    'page callback' => 'mymodule_admin_home',
    'access arguments' => array('access content'),
    'type' => MENU_NORMAL_ITEM,
    // ...
 );
 $items['mymodule/admin/settings/english'] = array(
    'title' => 'English Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => 'mymodule_makeEnglishSettingsForm',
    'type' => MENU_DEFAULT_LOCAL_TASK,
 );

The title I set for my page in my hook_menu module doesn't stick, instead, it sets the title to it's parent-most item. I know that I can use drupal_set_title($my-new-title) to fix it. But why is this misbehaving? What did I do wrong?

Upvotes: 0

Views: 632

Answers (2)

easysys
easysys

Reputation: 26

ITs problem with the cache, either you can clear the cache by navigating to admin/settings/performance or use cache_clear method.

Upvotes: 1

psparrow
psparrow

Reputation: 9948

Try clearing the menu cache after making your changes:

cache_clear_all('*', 'cache_menu', TRUE);

Or, if you have the Admin Menu module installed, go to /admin_menu/flush-cache/menu

Upvotes: 1

Related Questions