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

learn more… | top users | synonyms

1
vote
1answer
143 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
176 views
+50

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
25 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
9 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
19 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
17 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
25 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
15 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
20 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 = ...
0
votes
2answers
27 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
14 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
19 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
30 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
12 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
28 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
21 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
30 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
21 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
20 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 ...
1
vote
1answer
31 views

Multiple buttons to link to different page and different query

I have a page in my site (from a custom module) with a hook_menu (red boxes). The code for the menu is as follows: $items['upcoming_games/' . date('Y-m-d')] = array( 'menu_name' => ...
1
vote
2answers
33 views

Show a view's filter as a menu

I'm recently working on a view and i want to show the filters (two of them) as a menu. This means: That both filters can't be used at the same time (most important, a.k.a if one filter is already ...
0
votes
1answer
44 views

How do I add a menu item to the main navigation from a custom module in Drupal 8?

For my custom Drupal 8 module I want to add a link to the default main navigation menu of the site. What parent ID do I have to give to insert my menu item into the main menu? I currently have the ...
0
votes
0answers
21 views

customising menu tree as with two set of menu like in ul and select option

I am trying to alter drupal menu tree as below. to support desktop and mobile devices at once. <aside> <!-- For destop --> <ul class="hidden-xs"> ...
0
votes
0answers
39 views

Alter node menu local task weight of “View” and “Edit” for a content type

I want to alter the ordering of the node tabs for a particular content type. From this: View, Edit To this: Edit, View I tried with using menu_local_tasks_alter like this: function ...
0
votes
2answers
38 views

Using a template for a custom admin page made with hook_menu

I have developed a module in Drupal 7. Now, I want to add a custom themed-page in the admin panel of Drupal. I have added a page using admin_menu(): function newsletter_menu() { $info = ...
0
votes
0answers
18 views

Module-registered menu paths and non-existing pages lead to non-Drupal 404

I'm trying to build a custom module, but I think there's something wrong with my server settings and/or Drupal install. Whenever I navigate to a non-existent site path, or even a path that is ...
3
votes
1answer
27 views

MENU_CALLBACK with parent tabs

I have a module with a bunch of menu-items. Is it somehow possible to show the MENU_LOCAL_TASK's when a MENU_CALLBACK is called? The structure basically is like this: A normal menuitem in the ...
0
votes
0answers
87 views

Get header HTML content within a custom module

I have a custom module where I need to serve the content from the header and the footer into a blank webpage. This functionality is required by a 3rd party service and is not served to users, I have a ...
0
votes
1answer
28 views

Force access denied on 'admin/structure/menu' for everyone except admin

I need to write a "simple" feature in custom module which returns access denied for all the users except admin who tries to rich 'admin/structure/menu'. I've tried with hook_page_alter, ...
0
votes
0answers
21 views

Menu items Wildcards and Parameter Replacement

It is my module code: <?php function mymodule_menu(){ $items['mymodule/%f'] = array( 'title' => 'My account', 'page callback' => 'mymodule_hello', 'page ...
0
votes
1answer
18 views

Menu does not appear while opening my site

management menu such as add content type,module ,configuration does not appear in my site. So how can I solve it.
2
votes
1answer
25 views

Drupal 7 Wildcard menu like txt-txt-% is not locating

I wanted to create wildcard menu like text-text-% in drupal 7. But It works for if the menu is like text-text/% how can I make the above menu format to locate the action. $items['pin-code-%'] = ...
0
votes
1answer
57 views

Drupal 7 custom module menu hook is not working

I have created D7 module called 'mymodule' and enabled it from module list page. But the menu created inside the mymodule_menu() is not being called, instead redirects to 404 page. Below is the ...
0
votes
0answers
15 views

Hook menu in the page--front.tpl with a passed var

Given the url, for example: website/all I wish the hook_menu, to load the existing frontpage, currently using a page--front.tpl. passing the "all" arg to the page so I know I need to load all ...
1
vote
1answer
53 views

hook_menu create a URL/Menu Item

I'm trying to create a page through hook_menu so I can add my custom block with context instead. function my_module_menu() { $items['my_page'] = array( 'title' => 'my_page', ...
0
votes
0answers
52 views

List records in table and on click display details in form

I created a website which has two menus in it. One is to enter details of a person and the other to view list of entered persons. Here is the code function agents_menu(){ $items=array(); ...
0
votes
1answer
39 views

How to display a variable in callback hook_menu? [closed]

I'm creating a page with Hook_menu and I would like to display the user agent that page. This is my code to generate my page. /** * Implements hook_menu(). */ function custom_module_menu() { ...
0
votes
1answer
41 views

How can I reorder active menu items programmatically?

I have an 'audience' menu which has 4 links. When a user visits one of these links, it becomes active, and I want to push it to the front of the menu item list. Outcomes would like like; Pitchers | ...
0
votes
1answer
33 views

How to use hook_menu title arguments

Reading hook_menu it says this: "title": Required. The untranslated title of the menu item. "title callback": Function to generate the title; defaults to t(). If you require only the raw ...
1
vote
0answers
39 views

Custom menu with drupal_get_form plus form_alter_hook

I'm working in Drupal 6 to create a custom module. I have a menu that creates some custom URLs and tabs for me, and each item runs a page callback function, which itself runs drupal_get_form. What ...
0
votes
0answers
32 views

get last element in URL(menu item) generated by hook_menu

I have created a URL/menu item via hook_menu, and in the proprocess_html I'd like to get my item (last element in the URL) (/test) without using arg(0). I can do it in PHP but I was wondering how it ...
0
votes
1answer
44 views

Secure Way of sending argument from one page to another

In my Drupal Page I have one l() function as follows:- l('View Comments','admin/comments', array('query' => array('commentid' => $rinap_comm['record_id']) So in this case I am passing the ...
0
votes
1answer
35 views

How to use hook_menu to create wildcard aliases to a normal node page

I have a node template where I check the url for the existance of some parts and play with that, eg, if the node is called your/recipies, I catch urls like /your/recepies/bananas ...
0
votes
1answer
116 views

How to return JSONP from a menu callback

I can create JSON output using a menu hook using the drupal_json_output callback. Example: $items['page/%/json'] = array( 'access callback' => TRUE, 'page callback' => ...
0
votes
1answer
42 views

Enable/disable a menu item programatically depending on a variable value

I need to show a menu item only in certain moments. Imagine that I've a form with some options. If 'A' is selected, I need to enable a menu item that has a form for adding information about 'A'. I ...
0
votes
2answers
64 views

Render page callback output in another region than “content”

I am implementing hook_menu and I want to render the output of one page callback in a certain region, other than content. Is there a way of doing this?
2
votes
2answers
74 views

hook_menu parameter can contain a forward slash

I've built a custom module to get cloudinary images and it works great. However, a bug has cropped up. You can navigate to /cloudinary/resource/public_id and it gets the image with public_id. On ...
0
votes
1answer
57 views

How can I pass a long javascript string to PHP hook_menu in Drupal?

On mysite/build-order I have a long order code that I'm assembling using Javacsript and sending via _GET in the URL to a hook_menu page for processing. It can be as long as this (or longer), and am ...
0
votes
1answer
29 views

Landing page extension without 404 error

I have a problem concerning a landing page and 404 errors. Context : I have a content type "news", with auto url /news/my-news-title. I have created programmatically a kind of homepage for news, with ...
1
vote
2answers
95 views

All page access only to administrator in

I want to restrict my page access. Only an administrator should be able to see the page. I followed this tutorial function example_menu() { $items['example'] = array( 'title' => 'My Page', ...