Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [routes]

Using a term introduced in Drupal 8, routes are the paths to which modules respond.

1
vote
2answers
2k views

How to enable menu link when creating a new node?

I try to enable the menu link programmatically, here is how I do it: function create_menu_link() { $node = new stdClass(); $node->type = 'mytype'; node_object_prepare($node); $...
1
vote
1answer
3k views

I want to modify the drop down menus for Marinelli (a Drupal theme)

I have the Marinelli menu setup in a website I am internal testing. I want to modify the drop down menu (I know it uses jQuery), but I have no idea what to do to show the drop down all nested. In ...
8
votes
1answer
3k views

Custom module with its own menu?

I am in the process of writing my 3rd custom module and this one is my biggest challenge yet. I know how to use hook_menu to generate menu items, and depending on the path you choose determines where ...
3
votes
3answers
712 views

How can I add extra info to my menus?

I have some menus that are managed in the standard Menus module (Drupal 6, BTW). I want to add a checkbox when I'm editing a menu item to control the display of a "New" banner via CSS (by adding a ...
4
votes
3answers
10k views

Taxonomy menu with custom path for taxonomy terms

I am trying to make a taxonomy menu using the Taxonomy Menu module with a custom path for the taxonomy terms. Instead of /taxonomy/term/tid I want /proj/!tid (or ultimately /proj/!term-name but I'll ...
3
votes
2answers
2k views

How to make a MENU_LOCAL_TASK on a user's profile only appear on their profile?

I use logic like this to place a tab on each user's profile page so users can view analytics from the usage of a WebApp: // maps a url to a sub-page of user's profile, url to user's Analytics-...
2
votes
2answers
2k views

default routing of custom module

I'm trying to write my first module and am using the hook_menu to route the pages. The module consists of a multi-step form and two static content pages. /** * Implements hook_menu(). */ function ...
3
votes
4answers
3k views

How to hook theme of the main system menu in drupal 7 to display only some of the elements?

I want to modify the main system menu in Drupal 7. Actually I want to display only some specific elements of the menu and hide some other specific elements, in a given case (which I will implement by ...
7
votes
2answers
3k views

What is the equivalent of theme_menu_item in Drupal 7?

I know that in drupal 6 exist: theme_menu_item, but in drupal 7 there is not. Is there any replacements so that I modify the output for main system menu ? Actually I want to do a kind of filter of ...
2
votes
2answers
3k views

hook_preprocess_page: “node_load() + node_page_view()” versus “%node + node_page_view()”

A basic node (nid "123") exists and a module registered two paths using hook_menu: first/%node second Both page callbacks use node_page_view($node) to display a fullpage view of the node, except ...
4
votes
5answers
3k views

Putting items in multiple places in a menu

I'm trying to set up a menu layout which has two links to /biblio; one under "Researchers", and one under "Staff". This is for convenience, as if you are looking under "Staff", the "Researchers" ...
3
votes
2answers
260 views

Core forum form dropdown empty

In a D6 site, when a user goes to node/add/forum, they find that the dropdown "Forums" just shows "Please choose" but there is nothing in that menu. There is nothing in the PHP error log or in the ...
1
vote
1answer
842 views

Is hook_translated_menu_link_alter() thought to be used only on translated menu links?

Could hook_translated_menu_link_alter() be implemented to simply alter a menu link before it is rendered? Clearly, hook_translated_menu_link() is only invoked for menu items that have been flagged ...
17
votes
5answers
6k views

How do I add an access condition to a menu item?

How can I add new conditions on top of existing conditions that determine whether a menu item is visible? These conditions should not be limited to permissions settings. As an example use case (not ...