Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sub-Navigation Menu
#1
Hi,

I am trying to create a sub-navigation menu on my website which displays all the sub pages for the current page.

I am using the multi-level navigation plugin as a base for this plugin but have come across a slight problem.

The following code will correctly ouput all of the child pages for the selected parent page, however when i select one of these child pages I am struggling to get the menu to stay visible.

I am assuming it's something to do with the $menu variable not containing anything when a child page has been selected?

Code:
$menu = $data->xpath('//*[menuStatus=""][parent="'.$a.'"]');
        usort($menu,"menu_sorting");
        
        if (count($menu) > 0) {    
        
            echo "<ul class='submenu'>\n";
            
                    foreach ($menu as $link) {                
                        echo '<li'.("$link->slug"==$a?' class="active"':'').'><a href="'.$link->url.'">'.($link->menu!=""?$link->menu:$link->title).'</a></li>';
                    }
            
            echo "</ul>";  
        }

Any ideas how i can get this to output the sub menu when a child page has been selected also?

Thanks very much.
Reply


Messages In This Thread
Sub-Navigation Menu - by dclawson - 2010-02-18, 12:44:19
Sub-Navigation Menu - by Zegnåt - 2010-02-18, 23:42:37
Sub-Navigation Menu - by dclawson - 2010-02-19, 15:48:53
Sub-Navigation Menu - by caviar - 2010-04-07, 19:46:44
Sub-Navigation Menu - by dclawson - 2010-04-07, 23:30:32
Sub-Navigation Menu - by caviar - 2010-04-08, 23:04:38
Sub-Navigation Menu - by dclawson - 2010-04-26, 20:45:18
Sub-Navigation Menu - by Zegnåt - 2010-04-27, 17:02:13
Sub-Navigation Menu - by RobA - 2010-10-14, 06:08:16
Sub-Navigation Menu - by RobA - 2010-10-15, 06:14:06
Sub-Navigation Menu - by Zegnåt - 2010-10-15, 06:40:35
Sub-Navigation Menu - by RobA - 2010-10-15, 07:10:38
Sub-Navigation Menu - by ccagle8 - 2010-10-15, 10:06:07



Users browsing this thread: 1 Guest(s)