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

learn more… | top users | synonyms

0
votes
2answers
8 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. ...
0
votes
0answers
14 views

Fatal error: Unsupported operand types in \core\lib\Drupal\Core\Routing\RouteBuilder.php on line 174

I'm working on hover_card module for its D7 to D8 upgrade. While working around I've got the following issue which is a blockage in the further development! Fatal error: Unsupported operand types ...
1
vote
1answer
15 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
16 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
20 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
18 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
16 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
24 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
14 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
8 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
48 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
18 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
44 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
39 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
56 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
40 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
34 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
31 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
160 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
39 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
31 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
82 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
33 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
44 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
66 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
7 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
21 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
37 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
48 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
30 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
46 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
74 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
84 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
60 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
37 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
35 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
112 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
53 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
67 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
51 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 ...