Questions tagged [routes]

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

Filter by
Sorted by
Tagged with
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 ...
1
vote
2answers
437 views

How do I output the entire page template?

I've created a custom module that defines a menu callback; that menu path will call a function which performs some actions and once it's finished, it needs to display the theme with a message as the ...
3
votes
2answers
660 views

Menus - hard coded primary nav with per-page sub nav

My primary navigation is hard coded (it has to be; graphical purposes). Firstly, how can I tell which one is "active" (current page)? Secondly, based upon which one is active, how can I show child ...
1
vote
2answers
971 views

How to handle URLs like node/%.atom?

I am writing a module to generate a custom Atom feed, and I want to create URLs like http://drupalsite/node/20.atom or http://drupalsite/content/nodealias.atom. I was trying to implement it as ...
1
vote
2answers
217 views

Placing Panels Content Above Menu

I am trying to use panels to implement something that in the past I had done with blocks. My theme has a region called "content top", this displays content above the secondary menu (the tabbed menu ...
0
votes
1answer
549 views

menus and per page sub menus

I have my primary navigation (which is hard-coded into the theme). What I want is for a sub-menu (depending on the page) to appear in the left sidebar. For example, if they click on the primary link ...
2
votes
2answers
979 views

How do I set the active menu item dynamically for a view?

How do I change the active menu item when showing a view? This post shows me how to do it for node (using hook_nodeapi()), but how/when/where do I do it for a view? I tried hook_views_pre_view(), but ...
1
vote
1answer
293 views

Menu links not working in IE

When I click on certain links in menu in IE a page with error message "Internet Explorer cannot display this page" appears. Other browsers are OK. Problem is with these two links "http://localhost/?q=...
1
vote
1answer
5k views

Get the parent items of a menu item

How can I get the parent items of a menu item for a view? I added a Global: null argument in the view and I need to get the parent items of this view. The view is set to belong to a menu in admin/...
1
vote
4answers
589 views

If else for main menu

im trying to do a if else statement for the main menu, i have something like this but i dont know where to begin. <?php if ( !$is_front ) : ?> function bartik_links__system_main_menu($variables)...
0
votes
1answer
825 views

overlap dropdown menu and slideshow

I use Zeropoint theme and the drop-down menu in this theme. When I hover the mouse over a menu, and the menu is expanded, my submenu is placed under the slideshow and is not show completely. Do you ...
1
vote
2answers
5k views

How to create and set a new menu block in some content region, programmatically

I want to create a new menu programmatically add for him some elements and the activate it in some content region as a block. How can I do this programmatically? I know how to add for an existing ...
0
votes
3answers
2k views

How can I point to an internal anchor using core menu?

We have a navigation menu created using Drupal's built-in menu system. One of our menu items has the path set to "node/100770#digital-anchor," but when the menu is rendered, it strips off everything ...
1
vote
2answers
568 views

Is it possible to create a menu item and leverage path aliases?

I am trying to create a menu item that loads a view mode that calls the callback function with the path alias. $items['node/%/%'] = array( 'page callback' => '_node_view_load', 'page arguments'...
2
votes
1answer
142 views

Putting a form into a menu

I've started learning Drupal (I'm starting with Drupal 7) and the best way to do that seemed to me to be in creating a custom theme from scratch. I'm trying to create a menu in which the login form ...
2
votes
2answers
933 views

New link added in user page but not visible to non admin user in Drupal 7

I added this module in Drupal 7 for adding new tab in my site. This new tab is not visible to non admin user. Only visible to admin. I also tried to set permission in this direction admin> People> ...
2
votes
2answers
622 views

Custom module menu item declaration leads to error 404

function eventi_menu() { $items = array(); $items['eventi/book/%/'] = array( 'title' => 'Book', 'page callback' => 'eventi_book', 'access arguments' => array('allow booking'), ...
3
votes
3answers
956 views

Where is the Administer menu?

I can't find the "Administer" menu or it's members "Content Management" or "Site Building". I've tried disabling and re-enabling the core menu module, but still cannot see these menus. This is what I ...
1
vote
2answers
6k views

How to create a menu with background images for list items?

How would you make a menu that have a different background image for each <li> element in the menu?
1
vote
1answer
694 views

Adding Facebook Like-button to the User menu in the top-right corner

Do you think there is a way to make a Facebook Like-button appear in the User menu of Drupal 7, right besides the My Profile and Logout links? UPDATE: I'd like to add the button for my site and the ...
1
vote
1answer
1k views

Wildcards in dynamically generated menu

I'm working on a custom module, and I'm building menu items using entries in a database. These are being cached, and the database is only really updated about once a month. I'm having an issue ...
2
votes
1answer
761 views

How do I achieve 2 level tabs?

Drupal 6 had an easy way to do this, but D7 doesn't. I asked this question on the drupal.org forums, and I didn't get answer. Am I asking too much? I just want 2 level tabbed main menu where I can ...
5
votes
2answers
4k views

Why does the page callback have two arguments?

function menufun_menu() { $items['menufun/%/bar/baz'] = array( 'title' => 'Hi', 'page callback' => 'menufun_hello', 'page arguments' => array(1), // The matched wildcard. '...
2
votes
3answers
1k views

Using node_view() to display a node doesn't print local menu items

When using node_view() to display a node (via return from a function that's called in hook_menu()) the usual View/Edit tabs are missing. Is this expected behaviour?