Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. function _custom_menu_overview_tree_form($tree) {
  2. $output = '';
  3. foreach ($tree as $data) {
  4. $item = $data['link'];
  5. if ($item && $item['hidden'] == 0) {
  6. if(strtolower($item['title']) == 'about us page condition'){
  7. $output .= '<li class="right-nav">';
  8. }else{
  9. $output .= '<li>';
  10. }
  11. (0 == $item['plid']) ? ($class = 'parent') : ($class = 'child');
  12.  
  13. if(isset($item['options']['attributes'])) {
  14. $attributes = array('attributes' => array_merge($item['options']['attributes'], array('class' => array($class))));
  15. } else {
  16. $attributes = array('attributes' => array('class' => array($class)));
  17. }
  18.  
  19. $output .= l($item['title'], $item['href'], $attributes);
  20.  
  21. if ($data['below']) {
  22. $output .= '<ul class="sub-menu">' . _custom_menu_overview_tree_form($data['below']) . '</ul>';
  23. }
  24. $output .= '</li>';
  25. }
  26. }
  27. return $output;
  28. }
  29.  
  30. $menu_items = menu_tree_all_data('your menu name');
  31. echo '<ul class="foot-nav">' . _custom_menu_overview_tree_form($menu_items) . '</ul>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement