This hook enables modules to register paths in order to define how URL requests are handled.

learn more… | top users | synonyms

0
votes
0answers
32 views

hook_menu stopped updating the menu system on rebuild [on hold]

For some reason hook_menu has stopped updating the menu for any singular input tried. I can't really see any particular reason why it is not presently working. We've put a watchdog function inside, ...
0
votes
1answer
31 views

Creating custom tpl using drupal 7 [on hold]

I'm trying to create custom tpl file with custom menu in drupal 7 but i cant able to achieve it with header and footer. I tried using hook_theme but it renders the page content but not the common ...
-1
votes
1answer
12 views

Variable number of arguments for drupal_get_form in hook_menu [closed]

I've got an instance of hook_menu. I've got a form that CAN take two arguments, but only needs one of them. $items['admin/structure/entities/create/%/%'] = array( 'title' => 'Create New ...
0
votes
2answers
22 views

Difference between .info files hook_menu() file key? [closed]

What is the difference between declaring the files[] in a module's .info file and declaring the file inside a hook_menu() item? According to the Drupal Documentation on .info files... When a ...
0
votes
1answer
12 views

title_callback not working for certain user in hook_menu

I am developing a module to manage Human Ressources. I implement hook_menu with a title_callback like this: $items['intranet/hr/%user'] = array( 'title callback' => 'user_page_title', 'title ...
0
votes
1answer
17 views

How can I hide the title in a custom page made with hook_menu?

I need to hide the title on a custom page created using hook_menu. I don't have a nid, so probably I can't use one of the existing modules to do that. function mymodule_menu() { $items['mypath'] = ...
0
votes
1answer
12 views

hook_menu does not match [duplicate]

I have a module where I try to catch an url to use a specific function. function my_module_menu(){ $items['beneficiaire/commande'] = array( 'page callback' => 'test_view', ); ...
0
votes
1answer
15 views

Fatal error: Unsupported operand types in form.inc [duplicate]

I'm getting the following error message: Fatal error: Unsupported operand types in /var/www/public_html/domain.com/includes/form.inc on line 1079 It seems to be because the following code for an ...
0
votes
1answer
21 views

Add Meta tags and Title on hook_menu “page callback”

How to add Meta and Title tags to the document head on hook_menu "page callback"? Drupal 7 Thanks!
0
votes
1answer
35 views

Need to change User Pages Title and Breadcrumb in drupal 7?

I want to change Title and breadcrumb for user pages to username to My Account. I don't want to user drupal_set_title or drupal_set_breadcrumb bcoz its in lots of pages I saw below code in user core ...
0
votes
1answer
26 views

Dynamically Alter Node Edit Tab Link

I would like to all the href of the edit tab link on several nodes. IOW: instead of example.com/node/%/edit I would like to substitute my dynamically created link ...
0
votes
0answers
16 views

Drupal page is not found error is showing [duplicate]

I am working on a project where I created a custom module to store data into database from a form. It is working fine. But now I am working on how to fetch the data from database and show the data in ...
0
votes
0answers
29 views

Access denied on hook_menu when admin

I had tried this without the access arguments originally, but I was getting access denied. So I tried adding it in with just "access content" and I get the same result. I get access denied as admin ...
0
votes
0answers
21 views

How to create an admin page that lists sub menus

I am trying to create an arrangement of menus / sub-menus that appear in the admin menu. So far I am able to have custom admin pages appear in the admin menu via: function custom_module_menu() { ...
2
votes
1answer
84 views

How to add custom fields to menu items

I've been looking at using menu attributes module for Drupal 7 to add an extra field to the menu navigation system. However this adds a new attribute to the attribute array and thus prints it out in ...
0
votes
1answer
29 views

Why my first tab is missing for local menu tasks defined by hook_menu()?

I am learning how to use hook_menu(). I am at a point where I have a question and not figure it out. I have a local task button inline with View and Edit and I want 4 sub-local_task buttons. See chart ...
0
votes
1answer
28 views

Cannot replace html.tpl.php with new template in a single module

I am creating a module to handle the reformatting of pages for printing in D7. The structure of the URL is: /print/{nid} I need to use a separate template than html.tpl.php as I have to get rid of ...
0
votes
2answers
51 views

How to build web app with Drupal

I would like to build a php based webapp. I am newbie with Drupal, but after some research I am convinced that Drupal may be the best solution for my web app. However I have some questions, here is ...
0
votes
1answer
27 views

Generate URL from hook_menu() pattern

Does Drupal have any tool to generate URL from hook_menu() link pattern? Something like this: some_function('node/%/edit/something/%', array(1, 19)) that will generate this URL: ...
0
votes
3answers
41 views

Is there a way to call “access callback” with parameters? [duplicate]

I have: function hook_menu() { $items = array(); $items['experiment-2'] = array( 'title' => 'Experiment 2', 'page callback' => 'drupal_get_form', 'page ...
0
votes
1answer
52 views

OG subscribe link rewrite

How can I remove or rewrite "group/node" and "og_user_node" from url when user click on OG subscribe link ? siteURL/group/node/63/subscribe/og_user_node Is there any module like pathauto where I can ...
0
votes
0answers
6 views

Calling an action as a callback for hook_menu

Hello I have an action that I want to get triggered when a page is requested. I can trigger a function as a 'page callback' in hook_menu. But is there a way to do something similar for actions? Thanks ...
-1
votes
1answer
18 views

How to restrict access to page by URL depending on which page you came from

I have page which implements by hook_menu and i want to permit access for this page if user come from certain form but not from just url string. How can i solve it? Thanks.
0
votes
2answers
33 views

Page not Found on hook_menu items

I have create simple hook_menu but when i clear cache retrieve Page not Found function sanabel_calculator_menu() { $items = array(); $items['iban_generator'] = array( 'title' => ...
1
vote
1answer
42 views

Page Arguments Not Getting Passed

My code was working perfectly, but at some point my hook_menu page arguments stopped getting passed. I am using versioning and can revert back to the previous code, but the page arguments are still ...
0
votes
0answers
11 views

Hook Menu with the Features Module?

I have been working on a image gallery module using the features module. Using the views module, I created an Admin page to manage the image gallery. My goal is having that image gallery Admin page on ...
1
vote
1answer
23 views

Nesting Navigation Tabs

In my custom module, I'm defining a menu_item with the type MENU_NORMAL_ITEM. In the default bartik theme, this adds a new navigation tab (next to the Home tab). This is great; however, I need nested ...
0
votes
0answers
3 views

Translating menu item

According to https://www.drupal.org/node/323101, we should not use t() for the title and description of each menu item anymore. I have some menu items listed in Main menu that are generated ...
0
votes
0answers
36 views

Wildcard links in normal menu

Im trying to to generate some links from my custom module that behave like they were a MENU_LOCAL_TASK, but are actually a MENU_NORMAL_ITEM, which reside in a normal menu instead of tabs. The Problem ...
0
votes
3answers
68 views

Can we use Same URL in different hook menu?

I am just learning about hook_menu just the basic stuff about creating module and all. I came across this question in mind but could not find clear answer for this Are we allowed to use same URL in ...
0
votes
2answers
61 views

hook_menu/MENU_CALLBACK access denied

I am using hook_menu() to generate a series of MENU_CALLBACKS for processing data at various points in my sites operations. However, while these work for the admin, when trying to access the pages I ...
0
votes
1answer
49 views

Drupal doesn't output list of children on custom module page

I am on Drupal 7. I want to create a page that lists its children, the same way you see the list of links in 'admin/structure' (Blocks, Content types, Entity types ...). I have modified child 1 and ...
0
votes
0answers
33 views

Custom administration menu created from views

I created several views (with page display) as custom administration pages and I'd like to create a custom menu block to Management menu. I started to develop a very simple module for this task: ...
1
vote
1answer
30 views

Add module-generated pages to Drupal 7's search index

I have a custom module that provides pages via hook_menu(). The page callback returns HTML-formatted output that is then displayed. The information is fetched from an external database, so it is not a ...
0
votes
0answers
88 views

Problem with character encoding ( danish æ ø å ) when using page handler include files in hook_menu().

When I use an .inc file to handle my page output, all the danish special characters (Æ, Ø and Å) shows up as question marks, i.e. they are rendered with the wrong character encoding. This following ...
2
votes
3answers
50 views

Can I Run custom callback in site maitenance mode

In drupal site maintenance mode all custom menu callback is not working. it redirect into site maintenance page. But user/login is working. I need to create menu like user/login. please help me.
0
votes
1answer
54 views

Always expanded menu items not showing up expanded in custom menu

I have a custom menu profile-menu and have configured a block to display that menu. It has four menu items with 'expanded' => TRUE. However, during test runs these expanded menu items do not show ...
0
votes
1answer
25 views

I want to navigate to particular tab on clicking of particular menu item

This is my menu This is my Media page on that I have 2 tabs for that I have used UI Tabs jQuery I'm using Drupal 7 menus i.e main menu, I want when user clicks on the News from the menu item it ...
0
votes
1answer
46 views

Passing an object to hook_menu

I am trying to pass an object from a function to the menu item (Not sure if drupal allows that), I get the following error 'Recoverable fatal error:Object of class stdClass could not be converted to ...
1
vote
1answer
79 views

How to hide my hook_menu items from the navigation menu?

I've got a custom module which I use to define some urls that are used for a json api. I don't want them to show up in the Navigation menu. How do I change my hook_menu configuration so these urls are ...
0
votes
1answer
44 views

Show sub menu via hook_menu

Sorry for asking such a question, but I'm still new in Drupal. I want to show sub menu via main menu. Ex: - Top menu 1) Home a. Report b. Comment 2) Shopping a. Audi b. Honda In this case, ...
0
votes
2answers
52 views

Custom menu items with hook menu

I'm using hook menu here for the first time as token menu doesn't seem to be doing what I need. In the end, I need a menu that will use a wildcard and load a view based on that wildcard. I have the ...
1
vote
3answers
83 views

Render alternative content if user is logged in instead of redirecting to user/uid

I have a menu router with type MENU_CALLBACK and it's 'page callback' property points to a function that implements render API, as follow: /** Implements hook_menu **/ function custom_render_menu() ...
0
votes
1answer
82 views

Entityform - “The form has become outdated.” error

I have an entityform that appears on a page, for some reason the form will not submit ... // implement hook_menu function foiagen_menu() { $items['node/%node/foiagen'] = array( 'title' => ...
0
votes
1answer
61 views

Access denied: 'view published content' permission

When I look into admin/people/permissions: 'View published content' is checked for anonymous users. Yet the following code: function test_menu() { $items['test'] = array( 'title' => 'Test', ...
0
votes
0answers
14 views

Add a link in a menu

I want to create a menu of existing page via hook. I have a module that is called dw_blocks, which contains a hook_menu () In this function, I create a new 'step' menu that works. And now, I will ...
0
votes
2answers
90 views

How do I add HTML to my module's custom admin page?

I have set up a new page in my admin for my module like so: /** * Implements hook_menu(). */ function scraper_menu() { $items = array(); $items['admin/scraper'] = array( 'title' ...
0
votes
1answer
52 views

How to create main links like home ,services programatically? [closed]

I am creating a new website in Drupal 7,but from my past efforts I tried adding main menu links(home,services,clients,blog etc)but all in vain!! Can anyone tell me how to create main menu links ...
0
votes
1answer
30 views

Translate menu with wildcard

I am creating a menu item using hook_menu() and what I want is to translate it when I am using a wildcard, because I have a multilingual site. There is a solution, using t()[, but it's not the best ...
0
votes
2answers
38 views

hook_menu implementation producing error page

I am trying to create a new module implementing hook_menu, to render a page on my company's web site, which I have taken over from the external firm who designed it. There are other modules that use ...