Questions tagged [hook-menu]

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

As defined in Drupal API Docs:

This hook enables modules to register paths in order to define how URL requests are handled. Paths may be registered for URL handling only, or they can register a link to be placed in a menu (usually the Navigation menu). A path and its associated information is commonly called a "menu router item". This hook is rarely called (for example, when modules are enabled), and its results are cached in the database.

60 questions
0
votes
1 answer

Drupal 7 hook_menu checkboxes issue

I am trying to put together a module which will have it's own configuration page. For that purpose, I am using the following code as my menu page-callback: function webform_customizations_customize() { $form = array(); // Text field for the…
sisko
  • 9,604
  • 20
  • 67
  • 139
0
votes
1 answer

Drupal 7 menu but no clean-urls

I am in the process of developing a module which needs to make an ajax call to a menu path defined by the same module. Below is the hook_menu function: function staff_filter_menu(){ return $items['staff/filtering/results'] = array( …
sisko
  • 9,604
  • 20
  • 67
  • 139
0
votes
1 answer

Drupal 7: print theme from hook menu with good performance

I'm working in a hook menu for a custom route, like this: function mymodule_menu() { $items = []; $items['myroute/%'] = array( 'page callback' => 'my_callback', 'page arguments' => array(1), 'access arguments' =>…
danielarend
  • 1,379
  • 13
  • 26
0
votes
2 answers

hook_menu Title

I'm having some trouble with the titles of my pages. English Settings Page : $items['mymodule/admin'] = array( 'title' => 'Administrate', 'page callback' => 'mymodule_admin_home', 'access arguments' => array('access content'), …
rlb.usa
  • 14,942
  • 16
  • 80
  • 128
0
votes
1 answer

Drupal: Horizontal Menu

I'm trying to programmatically create the custom horizontal menu for my custom module, but I'm having a lot of trouble. I want to make a horizontal menu like this : This is my code so far, but it only displays on the main left vertical sidebar…
rlb.usa
  • 14,942
  • 16
  • 80
  • 128
0
votes
0 answers

Drupal 7 :Fatal error: require_once(): Failed opening required '

im new in drupal 7. I created a custom module in Drupal 7 "audit_pdf" for Extranet. In this module i created a sub-module "audit" who display a custom form. The form is in audit.pages.inc The audit_menu in audit.module audit.module function…
Valentin
  • 25
  • 7
0
votes
3 answers

hook_menu in drupal 7 when i pass url. It shows Page Not Found

here is my code function custom_menu() { $items['award/offer'] = array( 'page callback' => 'award_offer_email', 'page arguments' => array(1,3), 'type' => MENU_CALLBACK, ); } Here I have passed the url like…
0
votes
2 answers

Drupal hook_menu from module for admin menu

I have a custom module "menu_mods" for adding menu items to the admin menu. It's not adding it. I want the link to show in the Navigation menu. I'm using the Garland theme for the admin pages. Here is my module code: function menu_mods_menu() { …
EricP
  • 1,459
  • 6
  • 33
  • 55
0
votes
1 answer

Why am I not getting my own page - drupal hook_menu

I have a module I'm creating and its purpose is to import a specific type of data and append it to nodes depending on that data. To do this, I need to create a page letting the user enter where the data is stored at for the system to import. To do…
Malfist
  • 31,179
  • 61
  • 182
  • 269
0
votes
1 answer

hook_menu giving 404

I am trying to create a simple module in Drupal 6.20 as follows:
Hasan
  • 33
  • 5
0
votes
1 answer

Drupal 7 hook_menu() throws a 404

I have tried to acces it through an ajax call and by simply going to it by url, It always give me a 404 i have flushed my caches multiple times and even tried to remove and re-add the module (as i have had the problem with other modules and read on…
PudiPudi
  • 38
  • 8
0
votes
1 answer

Add 3 custom menu links to the navigation menu

I am using Drupal 7 and I want to add 3 menu links to the navigation menu. The links are based on the current logged in users 'uid' but I can't get it to work. I have checked this site out and ever example uses a custom module to implement. I am…
0
votes
1 answer

Drupal hook_menu wildcard on first argument

I am looking to make a wildcard page on $items['%/pagename'] But I can't get it to work. Anyone got a solution?
Falko Woudstra
  • 174
  • 1
  • 10
0
votes
1 answer

Is there a way on how to post data from a native mobile application then save the data through the Drupal Website?

Is there a way to post data from a native mobile application written in HTML, CSS and JQuery then save the data through the Drupal Website (particularly on the Webform module)? Let's say, in my native mobile application, I have this set of…
Marylyn Lajato
  • 1,171
  • 1
  • 10
  • 15
0
votes
1 answer

Drupal 7 hook_menu with type MENU_CALLBACK gives 403 error

I'm trying to implement a json endpoint via hook_menu. Here is my code: function gcm_subscribe_menu() { $items['gcm_subscribe/subscribe'] = array( 'title' => 'Test-Endpoint', 'page_callback' => 'gcm_subscribe_ajax_subscribe', …
bahuma20
  • 23
  • 7