: How do you create links with a NULL or # in Drupal? Trying to create folders for links where the parent has no content, it's just a folder. Need to be able to insert #, but Drupal is saying
Trying to create folders for links where the parent has no content, it's just a folder. Need to be able to insert #, but Drupal is saying it's not a link. Just want the user to click it and nothing happen, the child of that menu item will already be being displayed without a click.
Version: Drupal 6 (appears worked in D5)
I've attempted the following: '', #, <#>, empty, <empty>, null, <null>, blank, <blank>, <none>, none, <answer> ...just kidding.
ERROR: The path '<insert_non-url>' is either invalid or you do not have access to it.
Question, just ask -- thanks!
More posts by @Shelton105
4 Comments
Sorted by latest first Latest Oldest Best
$("#block-menu_block-1 li.expanded > a").removeAttr("href");
I use this to get rid of href of the first level of li a.
This makes it possible to use the first a links in a menu as non click able categories.
This is a bit ugly but it works for smaller things :)
You could just make a bogus link to anything, perhaps the homepage and then use jQuery to turn off the click by adding something like this:
$('.menu-item-classorID').click(function(){ return false; });
Quick and dirty method but does the trick in a pinch. Use menu attributes module to add class or ID to a menu item.
I always use the Special Menu Items module, which allows you to enter "nolink" as path. A 'nolink' menu item will render as a normal menu item without <a> tag, but you can style it differently if needed.
#
Drupal takes it as input, but it returns an error in the navigation, but at least I've got a menu item. Posting this for now until someone post an answer that Drupal 6 takes as input, and does not produce an error.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.