Jump to content

Array Menu system help


marksie1988

Recommended Posts

hi, i have created a menu using an array but now we have the need to have sub menus which would change only once the link for that section was clicked. i have managed to get the sub menu working but as you can see depending on wether the page is selected depends on the button style.

 

the issue i have is that the style isnt applying to the submenu, how would i be able to do this i have been trying for ages but its just confusing me.

 

<?php	
$serviceLinks = array (1 =>"?subSelection=Network Services", 
                                    "?subSelection=Project Management", 
                                    "?subSelection=Managed Services", 
                 			"?subSelection=Storage Management", 
				"?subSelection=Virtualisation",
				"?subSelection=Migration Services", 
				"?subSelection=Outsourcing",
				"?subSelection=Installation",
				"?subSelection=Telecoms",
				"?subSelection=Software Development",
				"?subSelection=Disposal Services",
				"?subSelection=Website Solutions"
				"?subSelection=IT Compliance",
				"?subSelection=Referrals"   );

$sideNavLinks["service"] = $serviceLinks;


////////////////////////////////

	$subsel = $_REQUEST['subSelection'];

	if($subsel == 'Network Services'){			

			$serviceTitle = array (1 => "Back To Services", "Network Design", "WAN Optimisation", "Wireless Networking", "Installation & Cabling", "Home Workers & VPN's" );


			$sideNavTitles["service"] = $serviceTitle;

			$serviceLinks = array (1 =>"allservices.php",

						"?subSelection=Network Services&sub=Network Design",
						"?subSelection=Network Services&sub=WAN Optimisation" , 
						"?subSelection=Network Services&sub=Wireless Networking",
						"?subSelection=Network Services&sub=Installation",
						"?subSelection=Network Services&sub=Home Workers"
			);

			$sideNavLinks["service"] = $serviceLinks;
	}

	if($subsel == 'Website Solutions'){			

			$serviceTitle = array (1 => "Back To Services", "Website Hosting", "Website Design", "Domain Name Registration");

			$sideNavTitles["service"] = $serviceTitle;
			$serviceLinks = array (1 =>"allservices.php",

							"?subSelection=Website Solutions&sub=Website Hosting",
							"?subSelection=Website Solutions&sub=Website Design" , 
							"?subSelection=Website Solutions&sub=Domain Name",
			);

			$sideNavLinks["service"] = $serviceLinks;
	}
////////////////////////////////
////////////////////////////////

////////////////////////////////

$tVar = $sideNavTitles[$thisPage];

$noLinks = 	count($tVar);
for ($x=1;$x<($noLinks+1);$x++) {
	if ( $sideNavSelected == $tVar[$x] ) {
?>
		<div class="sidenavbar"><span>
<?php 
			echo "$tVar[$x]"; 
?>
		</span></div>
<?php
	} 
	else {
?>
		<div class="sidenavbar"><a href="
<?php
   				$tVar = $sideNavLinks[$thisPage];
			echo "$tVar[$x]"; 
?>         
            ">
<?php 
			$tVar = $sideNavTitles[$thisPage];
			echo "$tVar[$x]"; 
?>
		</a></div>
<?php
	}
}
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.