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

learn more… | top users | synonyms

0
votes
2answers
17 views

Displaying hook_form

I have implemented a hook_form in my custom module and I can't figure out how I can get the form to display. Here is my hook form: function data_retrieval_form($node, &$form_state) { ...
0
votes
0answers
18 views

Programmatically add dropdown to administration toolbar

I'm trying to add a dropdown menu to the administration toolbar for my custom module but it is not appearing. I have flushed the cache and disabled/renabled the module but with no avail. I am using ...
0
votes
2answers
16 views

Retrieve argument in hook_menu() item url

On my custom module, I defined the following hook_menu() function. function motel_events_menu() { $items['ajax/pastevents/%'] = array( 'title' => 'Get Past Events', 'page ...
0
votes
1answer
22 views

HOOK_MENU multiple callbacks or another way?

So I have a hook_menu like this: function mortgage_multi_view_menu() { $items = array(); $items['investments'] = array( 'title' => 'Investments', 'page callback' => ...
0
votes
1answer
18 views

JSON Menu Link Without Invoking Init Hooks?

Our Drupal site utilizes a number of menu hooks to return JSON from an API we manage in a separate Web API. We also have a number of intensive tasks that happen on each page load via the hooks_init in ...
1
vote
1answer
17 views

hook_menu drupal 7 shows in menu but not show page

I made module, and want to add settings page. Menu Item appear in settings dashboard, but when try access page it display dashboard with menu items again, thought URL is correct. return array( ...
1
vote
2answers
66 views

PHP require_once() warning with hook_menu

I'm writing a small module for learning purpose, where I try to create a module settings form using hook_menu() and form_api. Everything look good in my code but I still getting this error message : ...
1
vote
1answer
23 views

How do you go about using contexts and a menu page callback?

Currently we have a page that is generated by a hook menu page callback. The path is structured like menu/%location_name/menu/%parent_category/%child_category. The function requires at least one of ...
0
votes
1answer
30 views

Custom 404 error page issue

I want to have a custom 404 page that displays some additional information. I need to display the requested path that was not found and some pages suggestions based on that path (this is based on some ...
0
votes
1answer
24 views

Create node display custom tab

I'm trying to create tab in node display that links to node delete form. I used hook_menu_local_tasks_alter in template.php function mytheme_menu_local_tasks_alter(&$data, $router_item, ...
0
votes
1answer
26 views

Hook menu - title arguments

I have those menu elements declared in hook_menu function: $items['submission/%/id/%'] = array( 'title' => 'View submission', 'title callback' => 'fr_form_view_submission_page_title', ...
0
votes
1answer
20 views

menu item call from tpl file

I have create one form in .tpl file with simple html form tag. In action attribute of this form element i passed a url like 'action=savequestion'. Now in my .module file, inside hook_menu(), I am ...
0
votes
1answer
19 views

How do I effect the page that a menu item redirects to?

I am trying to do something that seems simple, but I have yet to have to do it with my development because I have always dealt with forms and views. On the page that I get redirected to when I click ...
1
vote
1answer
17 views

How to handle a post request from an external application in Drupal?

I am integrating with the Stripe payment gateway and I need to be able to handle a post from their server to authenticate a standalone account. I am trying to follow the instructions at ...
0
votes
0answers
14 views

Drupal ajax nav with friendly URLS

Im stuck on this... :-/ heres the problems im facing: The site navigation links should be in the form of: url.com/final-page I've managed to build out a ajax navigation module using a few ...
0
votes
0answers
35 views

menu page callback cache expiration, headers

Drupal 7, custom module to output data in JSON format. Task: create cacheable page that prints string in JSON format. function examplemod_menu() { $items['json'] = [ 'page callback' => ...
0
votes
0answers
22 views

How to call a Load function or (Auto-Loader Wildcards) of hook_menu() that is defined in external .inc file

We can define a callback function of hook_menu() in external (.inc) file but I have defined an AUTO-LOAD function in external (.inc) file then it is not working but if I defined in .module file then ...
0
votes
1answer
31 views

Add a link in management menu for specific role

I can't find the way to display a link in the management menu for specific roles. The link shows up only for administrator, despite all the access callbacks I tried. In the view displayed by the ...
0
votes
1answer
21 views

Menu access callback function called multiple times

I have following menu defined with access callback function. As You can see this is a hack so I can use REST via GET ( normally Services do not offer this ). All my endpoints are defined ...
0
votes
0answers
19 views

New tab added to existing admin menu not displayed (plus a bit more!)

In my custom module I have an admin menu opton with 2 tabs and it worked fine for times. Then I now added a 3rd tab. But this 3rd tab didn't appear (although obviously I'd cleared the cache). After ...
0
votes
0answers
15 views

How to implement a pop up form in hook_page_build

I'm trying to create a serial validator that pops up when the user goes to download a file. I already have a disclaimer in the hook_page_build() but I would like to expand upon this and then ask them ...
1
vote
1answer
17 views

menu access callback per role

I'm trying to implement an access callback per role for a specific menu item, but other roles can view that menu item also. Any tip is welcome. /** * Implements hook_menu(); */ function ...
0
votes
2answers
23 views

How to add new item in menu_local?

I'm using Drupal commons and I want to add new item next to View link, so I used hook_menu to create this. function manage_child_menu() { $items['node/%node/demo'] = array ( 'title' => ...
1
vote
1answer
20 views

How do I create a link to a view in Commerce Order listing?

I want to create a link on an order dropdown menu in commerce order that is attached to a view. So for example, when you are looking at the list of orders, there is a drop down menu which has Quick ...
0
votes
0answers
39 views

Displaying fields and populating value from database in textfield using ajax.

I am having one search form. In which I took three fields, Month, Year and Email address accordingly. 1. I want one text box field and submit button on condition like if all those three are field. ...
0
votes
1answer
44 views

How to call form function in menu callback in drupal7?

I have one menu and two functions that want to call on same menu. What I am doing is, in hook_menu page callback i am calling a function and in that function i am calling another function.Means, ...
1
vote
3answers
26 views

How do I allow access to my custom module to “anonymous user”

case : I have created a custom module Implemented a hook_menu() as shown function my_custom_menu() { $items = array(); $items['my/custom/link'] = array( 'title' => t('My Custom ...
0
votes
1answer
69 views

Not able to overwrite old value in Drupal.settings

I am facing Problems in overwriting old value in Drupal.setting. Problem Statement I am passing FID value from PHP to JS. At first it is getting correct value in JS. Ex. When PHP is passing FID=59 ...
0
votes
1answer
20 views

Apply hook_menu to all nodes except node593

I have 2 separate hook_menu callbacks going on in my code. I want to apply a function to all nodes and then for node593, I want to apply it's own function but I can't seem to do this. The function ...
0
votes
1answer
19 views

Multisite cannot find module in sites/default

I haven recently set up a multisite setup with Live, staging and tag as the domina/subdomains used by the code in the sites directory I have the modules set up like so: ...
0
votes
1answer
18 views

Theme hook MENU_CALLBACK not found

I am seeing this error in my logs: Theme hook MENU_CALLBACK not found What are the causes? I cannot find this exact phrase in google or d.o. This is an example menu item: ...
1
vote
1answer
156 views

Use hook twice in a single module

I have created a custom module with some inc files for different functionalities, these inc files adds config pages for admin but i had to define all urls in .module file. is it possible to use ...
2
votes
5answers
354 views

Split node edit tab in several tabs with panels (or programmatically)

I have a content type with many fields, so that loading node/%node/edit is a pain ! In order to split node edit form in smaller forms (menu tabs), I used Page Manager. What I did so far Enable the ...
1
vote
1answer
33 views

How to convert user menu tabs to menu links?

I have on user account 5-6 tabs created by some modules.My wish is to covert these tabs to menu items so as to insert to 2 separate menu links. I have read that something like that could be possible ...
0
votes
1answer
12 views

Can I call menu_rebuild() only for one module or specific hook_menu?

Is there a way to call menu_rebuild so it will only update items in selected module and / or hook_menu ? I need it to update links ( if they are already existing ) and add new ( if they are now ). ...
0
votes
1answer
21 views

Badge for menu link

I am building a Bootstrap 3 sub theme where I want to display some information next to menu link in main menu. I tried to implement hook_menu_link_alter in template.php file in following way function ...
0
votes
1answer
19 views

Why are my menu items not showing under the top level menu item?

I'd like my other 3 menu items to sit under Manage Instagram in my Admin/Config menu but they are all being created as individual top level menu items. function instagram_menu() { $items = ...
0
votes
1answer
28 views

Creating module can display map in page or block in drupal

I have two days I'm trying to develop my custom module. I want to display map in block but nothing happened. how i can called css an js file and show them in page or block? function exemple_init() { ...
0
votes
1answer
20 views

Hook_menu's access callback called multiple times?

I have this hook_menu implementation $items['lablab/%level/%unit/%tab/%section/%exercise/go'] = array( 'title' => 'My lablab', 'title callback' => ...
0
votes
1answer
49 views

How to add extra class in main menu in drupal 7

Here, I working in creating custom theme in drupal 7.I am struggling to create main menu with drop down.Here i create menu with custom code is <?php $main_menu_tree = ...
1
vote
2answers
49 views

How to add “publish content” to a node view tab

I'm developping a website where I'm asked to add a tab "Publish content" next to the Edit tab. I was told to use the hook_menu, but so far i didn't succeed in showing the tab. Here is what I have ...
0
votes
1answer
17 views

How to add a menu to Drupal with all external links from module code?

I am writing a module that gets data from a couple sources, mostly XML, and then creates a nested array of values, such as "Title" and "URL"/link. I'd like to create a new menu and then loop through ...
1
vote
1answer
24 views

How to pass a variable $ _ GET in a page?

I will wish to create a privileged space for some users. I create a role 'Candidate'. I assigned permission 'access user profiles' has this role. I create a user that uses this role. (eg, foo) ...
0
votes
0answers
36 views

Reuse form from another module in multistep form

I have built a multistep form, and it works fine. Now I have installed LoginToboggan module, It has the option of show a unified login/registration form. I would like to set the last step of my ...
1
vote
1answer
18 views

How to theme a custom object from an external datasource?

I am building a Drupal 7 website that has several Content Types (CTs) like Page, Event, Blog etc. For each CT, the full node view mode has been heavily customized using Display Suite. I am requested ...
0
votes
1answer
38 views

Page arguments - hook_menu

I have this two test menu items: $items['test/%id'] = array( 'title' => 'Test', 'type' => MENU_LOCAL_TASK, 'page callback' => 'drupal_get_form', 'page arguments' => ...
1
vote
1answer
23 views

Passing Argument in Drupal 6 not working

Im very new to drupal. Recently I have started learning drupal 6 with reference project done by my friend. It was having so many bugs and fixed most of from the list. Still Im not getting how hook ...
0
votes
0answers
31 views

Menu item URL not found

I've used this code below to create 2 empty pages (url1 and url2) where I implement custom block through either context or block. function myMenu_menu(){ $items['url1'] = $items['url2'] = array( ...
1
vote
1answer
23 views

The 'drupal' way to implement delete button UI: part 2

I asked this question earlier The 'drupal' way to implement delete button UI The answer worked perfectly. I would like to take it a step further and make sure my routing is done the best way for ...
0
votes
1answer
22 views

The 'drupal' way to implement delete button UI

I think I'm missing something fundamental here. What's the 'right' way to implement a delete button on the UI-end? My app has a classic list-type data model: User has wishlist(s) -> wishlist has ...