Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4005866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:26:45+00:00 2026-05-20T08:26:45+00:00

How can I create a new route/menu in Drupal that doesn’t automatically render a

  • 0

How can I create a new route/menu in Drupal that doesn’t automatically render a navigation link?

I’m trying to create a simple page callback in Drupal that doesn’t show up in the Navigation menu.

I have a module named helloworld.

The .module file contains the following

function _helloword_page_callback()
{
    return array('#markup'=>'The quick brown fox says hello, and the lazy dogs thanks you
    for following conventions.');
}

function helloworld_menu()
{
    $items['helloworld'] = array(
      'title'               => 'Hello World',
      'page callback'       => '_helloword_page_callback',
      'access arguments'    => array('content'),
      'type'                => MENU_CALLBACK
    );
    return $items;
}

This successfully exposes a URL on the site of

http://example.drupal.com/helloworld

However, I’m still getting a link in the left hand (Bartik) navigation menu, despite the use of

'type'              => MENU_CALLBACK

So, why isn’t this working? Am I configuring the Menu item correctly? A more likely question: How am I misinterpreting the use of the menu type constants/system? Are there additional caches to clear that

drush cc all

wouldn’t take care of? What other steps can I take to debug this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:26:46+00:00Added an answer on May 20, 2026 at 8:26 am

    There must be something else wrong (perhaps you forgot to clear the caches ?) because even with Bartik, it works as expected. In that example, only “Hello 2” is shown in the navigation:

    function helloworld_menu(){
        return array(
            'hello1' => array(
                'title'               => 'Hello 1',
                'page callback'       => 'helloworld_page_callback',
                'access arguments'    => array('content'),
                'type'                => MENU_CALLBACK
            ),
            'hello2' => array(
                'title'               => 'Hello 2',
                'page callback'       => 'helloworld_page_callback',
                'access arguments'    => array('content')
            )
        );
    }
    
    function helloworld_page_callback(){
        return array('#markup'=>'The quick brown fox says hello, and the lazy dogs thanks you for following conventions.');
    }
    

    By the way, there is a typo in your snipplet (helloroute_menu should be named helloworld_menu), but I assume this is due to code simplification before posting on StackOverflow.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How exactly can I create a new directory using Emacs? What commands do I
When I start a new ASP.NET project in Visual Studio, I can create an
To create a new event handler on a control you can do this c.Click
I can create a menu item in the Windows Explorer context menu by adding
I can create the following and reference it using area[0].states[0] area[0].cities[0] var area =
I can create a literal long by appending an L to the value; why
In Postgresql you can create additional Aggregate Functions with CREATE AGGREGATE name(...); But this
this question can create a misunderstanding: I know I have to use CSS to
Is there anyway I can create a not in clause like I would have
When you create a new MVC application, how is it different than a Web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.