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 6652049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:05:10+00:00 2026-05-26T01:05:10+00:00

OK, so I have a weird thing to do, I’d appreciate any help. When

  • 0

OK, so I have a weird thing to do, I’d appreciate any help. When you go to the Drupal admin panel and click Structure, you get a menu which contains Blocks, Content types, Menus and so on.

Is there a way I can programatically build one of those menus based on the path? For example if I have my module named test and all sub-actions of my module are located at www.drupalsite.com/admin/test/action_name, can I build my menu with all the /test/action_name there exist in the current module?

I know there’s the option of hard-coding the menu, but I want to avoid it if possible.

  • 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-26T01:05:11+00:00Added an answer on May 26, 2026 at 1:05 am

    It’s hard to be that descriptive without some more information but you’d just need to implement hook_menu() and loop through your list of actions, creating a menu item for each. Every time the menu is rebuilt your menu hook will be called and the current list of actions will be built as menu links. Something like this:

    function mymodule_menu() {
      $actions = mymodule_get_actions_list();
    
      foreach ($actions as $action) {
        $items['admin/test/' . $action->name] = array(
          'title' => $action->name,
          'access arguments' => array('some permission'),
          'page callback' => 'mymodule_callback',
          'page_arguments' => array($action->name)
        );
      }
    
    
      return $items;
    }
    
    function mymodule_callback($action_name) {
      // Load the action and display the page
    }
    

    After you call your custom code to create one of these actions, be sure to call menu_rebuild() so your hook runs and the new action is added to menu.

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

Sidebar

Related Questions

Now the weird thing is I have a user control UserControl1 in which I
i have a real weird thing going on. I am trying to get the
it's a really weird thing - i have a website that works perfectly in
I have come across a situation (which I think is weird but is possibly
I have this weird thing happening: when clicking spans in the navigation the content
I have this weird thing that I'm running into. Basically, in FF9.0.1, dragleave doesn't
I have this weird thing happening with my testcase, however rather than fixing it
I have yet another weird annoying thing going on with Zend. Basically, I have
I have a really weird thing happening in my wpf application. Every time I
I have run in to some weird thing when I want to print one

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.