Closed (fixed)
Project:
Nice Menus
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
23 Oct 2007 at 00:19 UTC
Updated:
6 Dec 2007 at 23:51 UTC
Is it possible to implement a function like the following within nice_menus so that parent menu items can be made un-clickable?
function theme_menu_item_link($item, $link_item) {
if ($item['path'] == '<none>') {
$attributes['title'] = $link['description'];
return '<a href="javascript:void(0)">'. $item['title'] .'</a>';
}
else {
return l($item['title'], $link_item['path'], !empty($item['description']) ? array('title' => $item['description']) : array(), isset($item['query']) ? $item['query'] : NULL);
}
}
Basically, i'm using this in a theme function override right now so that I can put "<none>" in a menu item's "Path:" box, which generates href="javascript:void(0)" for that menu items link.
Thanks,
Nate
Comments
Comment #1
add1sun commentedI am not inclined to add this the Nice menus module as it really is more of a theme decision and not really specific to Nice menus. The "none" behavior would make more sense in a theme override so it could be used in any menu on a site that wanted this feature and not just Nice menus. I'm also not a fan of having Nice menus introduce Javascript beyond the minimal necessary to make the flyout CSS work.
I think it would make more sense to add this as an option to the handbook page that exists on the topic (http://drupal.org/node/143322) and then link to that as a tip from the Nice menus handbook page so anyone interested in it can implement it themselves.
Comment #2
nschindler commentedFair enough.
I'm unfamiliar with the method of getting content added to handbooks here. Is it better to add it as a child page, or a comment?
Thanks,
Nate
Comment #3
add1sun commentedYou can add something either way, it really depends on if the information should be included in an existing page or be a new page itself. I would say that this should be added directly to the existing page as an alternate to the
<spanmethod they are using.I am on the docs team though so I can take care of adding this in for you. I've moved this to a task for me to do soon.
Comment #4
nschindler commentedThat would be great!
The span tag mentioned in the handbook didn't work for me with nice_menus. It's been a while now, but IIRC, the menu simply didn't render properly using span.
Thanks very much for your help.
-Nate
Comment #5
add1sun commentedoops, finally got to this: http://drupal.org/node/194596.
Comment #6
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.