I was wondering how do I make the primary links have a sub level? I have more linux and windows links than what would likely display properly. I'd like to make the primary links basically be "windows" and "linux" and when someone clicks that they get a list of sites. Is it possible to do that? I know in 4.6 I could use the menu editing to make lower levels. I can't seem to do that with this. It demands a URL which it doesn't need if it's a menu title. I am using the Voodoo Dolly theme for anyone curious which one I'm trying to get to do this.

Comments

StevenSokulski’s picture

You can create nested links on Menus but the primary and secondary links are not generated by the menu module. To do what you would like you would want the Linux link to point to example.com/linusx and on that page have a list of links. Then do the same for Windows.

ishta’s picture

In 4.6x it was in the theme configuration. I told it in there under "General configuration" to not display primary or secondary links but it was doing it anyways. Which is why I was trying to see if there was a way I could make use of it in a way I liked. I liken it to the bookmarks bar in FireFox. I want to have the folder(menu title) that can be clicked and the list of links contained in it that people can go to. In 4.6x I simply made links within the Nav bar with the primary/secondary links off and then later went to making a block that contained buttons going to the various sites.(became a bit of a long list however)

Edit: Ok I'm going to try jsdomenu and nice menus and see if that sort of gets what I want. I still need to figure out why I can't easily shut off the Primary/Secondary links. The secondary seem to not be showing but the primary is. Also oddly enough viewing one page in the admin panel sometimes gets me a yellow bar with some comment in it. One on the left, one on the right and one center bottom. Is that normal under this new version for theme development? I do have themedev but it's not enabled.

drupal777’s picture

Coolmenus

ishta’s picture

I hadn't heard of that one. I know of jdosmenu or however that is spelled that was original in a few select 4.6x themes. Now it's a module offered and it allows for drop downs but in 4.6 it was the normal nav menu. I think the "Persian" theme used it. I want that similar effect where it has a top level menu label with the links below it. Sort of like how in firefox you have your bookmarks bar and it may contain folders. Clicking one of those folders gives you a links list which you can click and go.

I had tried one module that has some specific site links in it. But to my disappointment it doesn't look like the list of sites can be edited in drupal. It aims at google and del.ici.ous but I would of liked to added the links there. If I can't make use of the "Primary Links" in the fashioned I'd like I'm tempted to find a way to shut it off. It doesn't seem as easy to shut off as it was in 4.6x. :-/

Anyways I'll go have a look at the cool menu module. :-)

edit: Ok I didn't find a Cool Menu but I did find a Nice Menus for 4.7 and the other menu I mentioned is the jsdomenu. Which worked fine for me but I'm not sure if it works on all browsers the same. I would also still need to figure out how to make Primary Links disappear.

syawillim’s picture

Nice menu for 4.7 has a bit of a bug in it with IE, the sub menus display behind tables, dropdowns etc. Aside from that it works well and can replace pretty much any menu in your site.

I have a nasty hacked up version that only does dropdown menus and resolves the IE problem but it does need to be cleaned up a bit if anyone is interested.

www.justapickle.com
blogging community for the socially conscious

www.slickfish.com.au
professional, affordable web site design, production and maintenance for small business

drupal777’s picture

Teach me to respond off the top of my head. My apologies. Yes. Nice Menus.

And I'm interested in the hacked up version because I would never use it for horizontal menus, anyway.

syawillim’s picture

OK this is for a site that I have been working on so have only managed to get it sorted for horizontal drop downs and the colours are for that site.

nice_menu.module

<?php
// $Id: Exp $
/*
  By Jake Gordon (jakeg)
  Module to enable nice navigation menus
  Modifications and help by Simon Rawson.
  Further modification by Mark Harrison (syawillim)
*/

// Implementation of hook_help()
function nice_menus_help($section) {
  switch ($section) {
    case 'admin/modules#description':
      $output = t('Make drop down css/javascript menus for site navigation and admin menus');
      break;
    case 'admin/settings/nice_menus':
      $output = t('<p>This is a simple module that enables the site to have drop down css/javascript menus for site navigation and admin navigation.</p>');
      break;
  }
  return $output;
}


// Implemention of hook_menu()
function nice_menus_menu($may_cache) {
  if (!$may_cache) {
    drupal_add_js(drupal_get_path('module', 'nice_menus').'/nice_menus.js');
    theme_add_style(drupal_get_path('module', 'nice_menus').'/nice_menus.css');
  }
}


// Implementation of hook_settings()
function nice_menus_settings() {
  $form['nice_menus_number'] = array(
    '#type' => 'select', 
    '#title' => t('Number of Nice Menus'), 
    '#description' => t('The total number of independend nice menus you want. You configure them as normal in admin/blocks'),
    '#default_value' => variable_get('nice_menus_number', '2'),
    '#options' => drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8))
  );

  return $form;
}


// Implementation of hook_block().
function nice_menus_block($op = 'list', $delta = 0, $edit = array()) {
  global $user;

  switch ($op) {
    case 'list':
      for ($i=1;$i<=variable_get('nice_menus_number', '2');$i++) {
        $blocks[$i]['info'] = variable_get('nice_menus_name_'. $i, 'Nice Menu ' . $i) . ' (Nice Menu)';
      }
      return $blocks;
    break;

    case 'configure':
      $form['nice_menus_name_'. $delta] = array(
        '#type' => 'textfield', 
        '#title' => t('Menu Name'), 
        '#default_value' => variable_get('nice_menus_name_'. $delta, 'Nice Menu ' . $delta)
      );
      $form['nice_menus_menu_'. $delta] = array(
        '#type' => 'select', 
        '#title' => t('Source Menu Tree'), 
        '#description' => t('The menu tree from which to show a nice menu.'),
        '#default_value' => variable_get('nice_menus_menu_'. $delta, '1'),
        '#options' => menu_parent_options(0)
      );
      $form['nice_menus_type_'. $delta] = array(
        '#type' => 'select', 
        '#title' => t('Menu Style'), 
        '#description' => t('right: menu items are listed on top of each other and expand to the right <br />left: menu items are listed on top of each other and expand to the left<br />down: menu items are listed side by side and expand down'),
        '#default_value' => variable_get('nice_menus_type_'. $delta, 'right'),
        '#options' => drupal_map_assoc(array('down'))
        //'#options' => drupal_map_assoc(array('right','left','down'))
      );
      return $form;
    break;

    case 'save':
      variable_set('nice_menus_name_'. $delta, $edit['nice_menus_name_'.$delta]);
      variable_set('nice_menus_menu_'. $delta, $edit['nice_menus_menu_'.$delta]);
      variable_set('nice_menus_type_'. $delta, $edit['nice_menus_type_'.$delta]);
    break;

    case 'view':
      if ($menu_tree = _nice_menu_tree(variable_get('nice_menus_menu_'.$delta, '1'))) {
        if ($menu_tree['content']) {
          $block['content'] = "<ul class='".variable_get('nice_menus_type_'.$delta,'down')."' id='nav'>".$menu_tree['content']."</ul>";
          $block['subject'] = ($menu_tree['subject'] == t('Navigation') ? ($user->uid ? $user->name : t('Navigation')) : $menu_tree['subject']);

        }
      }
      else $block['content'] = false;
	  
      return $block;
    break;
  }
}

// Private functions below

function _nice_menu_tree($pid = 1) { 
  $menu = menu_get_menu($pid); 
  $output['content'] = ''; 

  $output['subject'] = $menu['items'][$pid]['title'];

  if ($menu['visible'][$pid]['children']) {
    foreach ($menu['visible'][$pid]['children'] as $mid) {
      if (count($menu['visible'][$mid]['children']) > 0) {
        $output['content'].= "<li id='menu-$mid'>".menu_item_link($mid);
        $output['content'].= "<ul>";
        $tmp = _nice_menu_tree($mid);
        $output['content'].= $tmp['content'];
        $output['content'].= "</ul>";
        $output['content'].= "</li>";
      } 
      else {
        $output['content'].= "<li>".menu_item_link($mid)."</li>";
      }
    }
  }
  return $output;
}

nics_menu.js

// $Id: Exp $
//We only add the javascript to IE.
if (document.all) {

  function IEHoverPseudo() {

    var ulNodes = getElementsByClass("nice-menu");
    var j = 0;
    var liNodes = null;

    for(var i = 0; i < ulNodes.length; i++) { 
      liNodes = ulNodes[i].getElementsByTagName("li");
      for(j = 0; j < liNodes.length; j++) {
        if(liNodes[j].className == "menuparent") {
          liNodes[j].onmouseover=function() { this.className += " over"; }
          liNodes[j].onmouseout=function() { this.className = "menuparent"; }
        }
      }
    }
  }

  function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	  if ( node == null )
        node = document;
	  if ( tag == null )
		tag = '*';
	  var els = node.getElementsByTagName(tag);
	  var elsLen = els.length;
	  var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	  for (i = 0, j = 0; i < elsLen; i++) {
		  if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		  }
	  }
	return classElements;
  }

  //This is the Drupal method of adding a function to the BODY onload event.  (See misc/drupal.js)
  // TODO: see http://drupal.org/node/50443
  addLoadEvent(IEHoverPseudo);
}

nice_menu.css

/* $Id: nice_menus.css $ */

/* below should fix menu being a few pixels away in some themes, and menus disappearing behind other stuff */
.block-nice_menus {
  line-height: normal;
  font-size: normal;
  margin: 0 1.5em;
}

/* most people won't want to see the menu's title */
.block-nice_menus h2 {
  display: none;
}

.down #nav, .down #nav ul { /* all lists */
	padding: 0;
	margin: 0;
	list-style: none;
	line-height: 1;
}

#nav a {
	display: block;
	width: auto;
	padding: 0.4em 1em 0 0;
	margin: 0;
}

#nav li { /* all list items */
	float: left;
	width: auto; /* width needed or else Opera goes nuts */
	list-style: none;
}

#nav li ul { /* second-level lists */
	position: absolute;
	background: #005c9c;
	border: 1px solid #000;
	border-top: 0;
	padding: 0;
	width: 10em;
	left: -999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
    z-index: 10;
}

#nav li ul li { /* second-level lists */
	border-top: 1px solid #000;
	width: 10em;
}

#nav li ul a { /* second-level lists */
	display: block;
	width: 10em;
	padding: 0.3em;
	margin: 0;
}

#nav li ul ul { /* third-and-above-level lists */
	margin: -1em 0 0 10em;
}

#nav li:hover ul ul, #nav li.sfhover ul ul {
	left: -999em;
}

#nav li:hover ul, #nav li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul { /* lists nested under hovered list items */
	left: auto;
}

#content {
	clear: left;
	color: #ccc;
}

Hope this helps.

www.justapickle.com
blogging community for the socially conscious

www.slickfish.com.au
professional, affordable web site design, production and maintenance for small business