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

learn more… | top users | synonyms

0
votes
1answer
15 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 ...
0
votes
0answers
13 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
7 views

How to add the date after an URL when missing [closed]

I have a menu item named "Meeting Rooms" with a path "/meetingrooms/2015-02-28" where that date is always today (in ISO format) if not supplied. I wrote a module that checks $arg[1] and if empty sets ...
0
votes
0answers
17 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
28 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
21 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
43 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
29 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
10 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
55 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
27 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
17 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
71 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', ...
0
votes
2answers
26 views

Override contributed module function

I'm wondering if it's possible to override a contributed modules hook_menu function. /** * Implementation of hook_menu(). */ function jquery_ajax_load_menu() { // Admin settings. ...
1
vote
1answer
23 views

How do i get the node id using menu_hook

Hi I try to get the node id when user edit the node by the code below: function test_plugin_menu(){ $item = array(); $item['node/%/edit'] = array( 'page ...
0
votes
1answer
24 views

admin menu item not displaying

I am developing a module which has an admin menu entry in Drupal 7. The issue I am having is that the menu item is not showing up in the admin menu. I have looked at the docs and scoured google for ...
0
votes
1answer
29 views

Pass arguments to a node

How do you pass an argument from a menu to an existing node? I've read many articles on hook_menu but they seem to all talk about creating a page which references the arguments. for example: ...
0
votes
1answer
22 views

HOOK_MENU custom url with argument

I am working with a 300K records dataset and I am having some performance issues. I try creating a node for each of the records on the dataset, but even the simple path translation query is taking ...
1
vote
1answer
18 views

Tpl for page having url like product/checkout/%/%

I have created a page with hook menu with url product/checkout/%/% where % will be userid and product id. How can I add a page tpl for this url ?
0
votes
0answers
7 views

Does a page created with hook_menu have a nodeid? [duplicate]

I created a page implementing the hook_menu, and I want to apply a theme for only this specific page. I know that I need to use something like page--node--nodeid.tpl.php, my question is does a page ...
0
votes
0answers
25 views

Tabs disappear when click on MENU_LOCAL_ACTION

I have used created a menu_hook in Drupal 7 as follows. Basically I want to have two tabs in my page as "Male" and "Female". Inside each tab, I want to have MENU_LOCAL_ACTION as "Add Male User" and ...
0
votes
1answer
18 views

hook_menu question

What is "access content" used as access argument in the following code? I don't see it in Drupal permissions. function hook_menu() { $items['example'] = array( 'title' => 'Example Page', ...
0
votes
0answers
25 views

How to assign an organic group menu to a view

I'm quite new to Drupal so forgive me if I'm a bit vague. If I have a view that has a menu with a default organic group assigned to it, how do I assign a menu belonging to another organic group to the ...
0
votes
0answers
17 views

Show the link in management menu as inactive link if the user doesn't have permission

I created new module in drupal 7 and of course I added some link to the managment menu like the following: <?php /** Implements hook_menu() */ function MY_MODULE_menu() { ...
0
votes
0answers
9 views

Resetting admin cache

I am having an issue with the cache on my site's admin section. I recently created a module that includes some admin pages. I made a mistake with hook_menu, setting the wrong permissions for the ...
1
vote
1answer
103 views

How to style a programmatically created page with a template?

I'm struggling with understanding theming pages with templates. I'm stuck with creating a new template for a programmatically created page. I have a module that shows a download page for a file. The ...
0
votes
2answers
23 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
13 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
19 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
121 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
58 views

Add Meta tags and Title on hook_menu “page callback” [closed]

How to add Meta and Title tags to the document head on hook_menu "page callback"? Drupal 7 Thanks!
0
votes
1answer
74 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
46 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
40 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
34 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
256 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
43 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
38 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
106 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
35 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
47 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
88 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
9 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
22 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
42 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
55 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
12 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
38 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 ...