1

When I access site via / or /fp, I always get 'Home', this only happens for the home page...How can I change the title?

$items['fp'] = array(
    'title' => 'Front Page',
    'page callback' => 'rocdocs_main_view',
    'access arguments' => array('access content'),
    'title callback' => 'rocdocs_main_view_title',
    'type' => MENU_CALLBACK
);


function rocdocs_main_view_title()
{   
    return 'THIS IS A TEST';
}
4
  • Is this drupal 6 or 7?
    – LSU_JBob
    Nov 29, 2011 at 17:14
  • This is drupal 7 Nov 29, 2011 at 21:15
  • 1
    In your code. The variable $items: Do you have a "return $items" at the end or is it not part of a function. Hard to see what's going on. Also what file do you have this in? your template.php file? or a custom module?
    – chrisjlee
    Dec 1, 2011 at 17:51
  • go with @ChrisJ.Lee here... its easy to miss the return in hook_menu()... also suggest you could check the logs for page not found for the request if thats the case... Dec 1, 2011 at 17:55

1 Answer 1

0

Just deactivate the predefined menu link and add a new one - use

<front>

as path.

In Drupal 7 and 8 go to

Home > Administration > Structure > Menus > Main menu > Add link

Drupal 7 Drupal 7

See tooltip for details (using Rubik Theme) See tooltip for details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.