"He averted a major costly disaster...". I've worked with roughly a dozen coders, graphics people and so forth in my past 10 years or so of business coaching and consulting. I've actually become pretty good at finding the right fit.

–Dan Nichols, America's Business Launch Expert(Michigan, USA)

Great job, love your work, exceeded my expecations once again.

–Mr. Robert Guinta (Sydney, Australia)

Another excellent job! Will keep working with the Raven team.

–Daniel Garcia (Miami, USA)

Raven developers did a great job on website optimisation and fixes for IE6 and generated a sitemap for very large website. I recommend them very much.

–Srdjan Bajic (Beograd, Serbia)

Excellent job again! A++++ coder

–Daniel Garcia (Miami, USA)

Great work, I am really impressed with the quality of work, your guidance and the professionalism that you display. Thankyou

–Mr. Robert Guinta (Sydney, Australia)

I had a really great experience with these coders. They are extremely detail oriented and worked very hard on a tedious project until it was completed exactly as needed. Highly recommended.

–Mr. Somlor (Washington, USA)

Very professional work, great standard.

–Mr. Robert Guinta (Sydney, Australia)

Very polite and easy people to work with :)

–Mr. Stephen (Calgary, Alberta)

High quality work, on schedule, very reliable, and were able to revise and revise until it was perfect.

–The Piano Man (San Diego, California)

Very good at listening and understanding.

–Lexxes (Bollnas, Halsingland)

Excellent work...very prompt service & most important very co-operative even with minutest changes...would work with this coders in future.

–Nitish Kanade (Newyork, USA)

Work was PERFECT!!!! Thank you!

–Robert Francia (Toronto, Canada)

My only regret in using these coders is they keep getting more popular. They are excellent - top shelf. Way above the curve on knowing what the client needs even over what they want. It's not like working with a vendor. It's more like a teammate relationship.

–DJ Dan Nichols (Royal Oak Michigan, USA)

Coder's work was very good and they followed everything we asked. Design was just want I wanted. Whole website was in div's and xHTML Strict Valid. They were very responsible on deadlines and often made comments and good time estimates. I recommend these coders very much.

–Srdjan Bajic (Beograd, Serbia)

I was surprised with the quality of work. I enjoyed working and communicating. A Gem! Thank you!

–Mr. Issac M (Brooklyn, USA)

I have found many great coders but sometimes you don't know that great can be topped. These coders are exceptionally great. They really branded me nicely, handled the request and did so thought-"fully".

–DJ Dan Nichols (Royal Oak Michigan, USA)

These coders completed all work to a high standard and worked to ensure that good communication channels where kept open throughout the project. Would and will be using again in the future.

–Chris Allen (Cambridge, England)


First things first, Drupal gives great amount of flexibility to both Module Developers and Site Developers, whether its about theming or creating your own little module that integrates into Drupal. For any thing to be themed ie. anything uses or calls Drupals theme() function there is an opening for site developer to change the default theming that takes place by default. So, for Nice Menus just check out the source code of this module where we have the theme() function call or lets say the theme hook, it takes place exactly at these two functions which are of our interest:

function theme_nice_menu($id, $menu_name, $mlid, $direction = 'right', $menu = NULL)

and

function theme_nice_menu($id, $menu_name, $mlid, $direction = 'right', $menu = NULL)

So, well use them as our starting point; in whichever theme youre working on there's template.php file designed specially for this kind of purpose. Open it up and place the two code segments below into it:

/*
  NOTE: BEFORE YOU ACTUALLY DO THIS PLEASE CLEAR ALL CACHES FROM YOUR DRUPAL SITE
  This is the point when Nice Menus renders a fully build Tree menu to the $output variable
  We change it here to be wrapped inside a table instead of UL elements
*/

function YOURTHEMENAME_nice_menu($id, $menu_name, $mlid, $direction = 'right', $menu = NULL) {
  $output = array();
  if ($menu_tree = theme('nice_menu_tree', $menu_name, $mlid, $menu)) {
    if ($menu_tree['content']) {
      $output['content'] = '<table width="100%" class="site-menu"><tr>' .$menu_tree['content'] .'</tr></table>'."\n";
      $output['subject'] = $menu_tree['subject'];
    }
  }
  return $output;
}
}

and the consequent theme function that actually builds the menu tree:

function YOURTHEMENAME_nice_menu_build($menu) {
  $output = '';
  global $is_child;
  foreach ($menu as $menu_item) {
    $mlid = $menu_item['link']['mlid'];
    // Check to see if it is a visible menu item.
    if ($menu_item['link']['hidden'] == 0) {
      // Build class name based on menu path e.g. to give each menu item individual style. Strip funny symbols.
      $clean_path = str_replace(array('http://', '<', '>', '&', '=', '?', ':'), '', $menu_item['link']['href']);
      // Convert slashes to dashes.
      $clean_path = str_replace('/', '-', $clean_path);
      $current_node = str_replace('node-', '', $clean_path);
      $path_class = 'menu-path-'. $clean_path;
      if ($current_node == $GLOBALS['active_node']) {
          $path_class.= ' active-content';
      }
      // If it has children build a nice little tree under it.
      if ((!empty($menu_item['link']['has_children'])) && (!empty($menu_item['below']))) {
        $is_child = true;
        // Keep passing children into the function 'til we get them all.
        $children = theme('nice_menu_build', $menu_item['below']);
        // Set the class to parent only of children are displayed.
        $parent_class = $children ? 'menuparent ' : '';
        if (isset($parent_class)):
          $output .= '<td id="menu-'. $mlid .'" class="'. $parent_class . $path_class .'">'. theme('menu_item_link', $menu_item['link']);
        else:
          $output .= '<li id="menu-'. $mlid .'" class="'. $parent_class . $path_class .'">'. theme('menu_item_link', $menu_item['link']);
        endif;
        // Build the child UL only if there is a child menu
        if ($children) {
          $output .= '<ul>';
          $output .= $children;
          $output .= "</ul>\n";
        }
        /* Notice that we have used <td> if we find a parent class otherwise it goes into <LI> elements WHY? Here's Why, All the parent menu items will be rendered inside table cells so our idea is to create a menu system that can resize proportionally and horizontally to the browser's full width, the subsequent child elements can be placed into <UL><LI> elements which can be themed easily */
        if (isset($parent_class)):
          $output .= "</td>";
          //Adds some extra separators after each td
          $output .= '<td><span class="sep1"></span></td>'."\n";
        else:
          $output .= "</li>\n";
        endif;
      }
      else {
        if ($is_child == false) {
          $output .= '<td id="menu-'. $mlid .'" class="'. $path_class .'">'. theme('menu_item_link', $menu_item['link']) .'</td>'."\n";
          //Adds some extra separators after each td
          $output .= '<td><span class="sep1"></span></td>'."\n";
        }
        else
        {
          $output .= '<li id="menu-'. $mlid .'" class="'. $path_class .'">'. theme('menu_item_link', $menu_item['link']) .'</li>'."\n";
        }
      }
    }
  }
  $is_child = false;
  return $output;
}

And there you have it output would turn out to be a table based menu like below:

Nice menu as table

And the HTML / XHTML code output for the menu would turn out to be like:

<table width="100%" class="site-menu">
  <tr>
    <td id="menu-262" class=""><a class="highlighted icon-bullet1 f-none" href="/content/our-views">Our Views</a></td>
    <td><span class="sep1"></span></td>
    <td id="menu-264" class="menu-path-node-4"><a href="/content/greater-depression" title="A Greater Depression">A Greater Depression</a></td>
    <td><span class="sep1"></span></td>
    <td id="menu-265" class="menuparent menu-path-node-5"><a href="/content/what-we-see" title="What we see">What we see</a>
      <ul>
        <li id="menu-266" class="menu-path-node-9"><a href="/content/too-much-growth" title="Too much growth...">Too much growth...</a></li>
        <li id="menu-267" class="menu-path-node-10"><a href="/content/too-much-money" title="..too much money..">..too much money..</a></li>
        <li id="menu-268" class="menu-path-node-13"><a href="/content/and-exits-closed" title="..and exits closed.">..and exits closed.</a></li>
      </ul></td>
    <td><span class="sep1"></span></td>
    <td id="menu-269" class="menuparent menu-path-node-14"><a href="/content/what-we-expect" title="What we expect">What we expect</a>
      <ul>
        <li id="menu-270" class="menu-path-node-15"><a href="/content/5-years-out" title="5 years out">5 years out</a></li>
        <li id="menu-271" class="menu-path-node-16"><a href="/content/what-we-foresee-next-3-6-months-nov-19-2008-updated-nov-25-2008" title="What we foresee for the next 3-6 months">3-6 months</a></li>
        <li id="menu-272" class="menu-path-node-17"><a href="/content/our-1-month-outlook-nov-19-2008" title="Our 1 month outlook (Nov-19, 2008)">1 month outlook</a></li>
      </ul></td>
    <td><span class="sep1"></span></td>
    <td id="menu-273" class="menuparent menu-path-node-18"><a href="/content/cures" title="The cures">The cures</a>
      <ul>
        <li id="menu-292" class="menu-path-node-28"><a href="/content/credit-default-swaps-undoing-nightmare-first-ideas" title="Credit Default Swaps - Undoing a Nightmare - First Ideas">CDS/CDO cleanup</a></li>
      </ul></td>
    <td><span class="sep1"></span></td>
  </tr>
</table>

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <div> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <p> <h1> <h2> <h3> <h4> <h5> <h6> <acronym> <blockquote> <b> <i> <font> <table> <object> <embed>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

2 + 15 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.