Hi,

How do i create a menu item that links to nothing?

I have a situation where i want a parent item to exist only as a way of "holding" other children items. The children items will link to pages, but the parent item wont.
The current way, every menu item must have a link.

Example:

  • Products (main menu)
    • Food (no link)
      • Bread (link)
      • Rice (link)
    • Drinks (no link)
      • Juices (link)
      • Sodas (link)

Comments

doomed’s picture

By the way, i have tried linking to # but it doesnt work the way i wanted, as it always end up linking to http://mysite/myfolder/%2523

roopletheme’s picture

Ah, the dreaded 'placeholder menu item' question. There's some discussion of this, along with some options, in this thread:

http://drupal.org/node/128618

doomed’s picture

Hmm thanks but i'm afraid those solutions wont work with Litejazz because Litejazz already uses its own suckerfish scripts ?

roopletheme’s picture

I guess the stuff about the DHTML menu module doesn't really apply, since it essentially does the same thing as the suckerfish code. But the conversation about the Drupal menu structure is all relevant. And the most important part is the fact that a Drupal menu item has to have a link... that's just the way it works. Under version 5, the link validity wasn't enforced, so you could just drop a # in the link field. Drupal6 enforces local link validity, so that doesn't work anymore. Since the LiteJazz suckerfish menus are nothing more than CSS code on top of the Drupal menu systems, that's the way it works too. Same with every other Drupal theme that I'm aware of.

I haven't looked closely at the DHTL Menu code to see how they implement a placeholder menu option, so I can't speak with any authority. But I can think of ways to implement placeholder menu items in a module. Such functionality makes more sense (to me, at least) in a module than in a theme. I'm sure if you did a search that you would find an issue against the core menu code to add this feature... haven't done this myself, but I bet it's out there.

OUSooners75’s picture

do away with the #

I was needing these placeholder menu items as well. Since Drupal 6.x does not allow you to have placemats, the solution I used was pretty simple.

In the path when creating the "placeholder", type in http://www.yoursiteurl.com. The only problem is the visitor may click on it and get frustrated for leaving the page they were on.

Another way is to created a filemanager type page and link it to that.

I do wish Drupal would allow for non-linked menu items. This is the only draw back I have encountered thusfar.

roopletheme’s picture

Status: Active » Closed (fixed)
bellkiss’s picture

I'm using Garland_dropmenu and want to do the same thing with my main menu links... just trigger the dropdown.

Anyway for now I do the same as above only that i enter http://www.yoursiteurl.com/# and that works ok, but only on the front page :(