View Single Post
Old 12-06-2012, 09:45 AM   PM User | #4
alexandruv
New to the CF scene

 
Join Date: Dec 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
alexandruv is an unknown quantity at this point
OK so I changed it a bit to this:

Code:
function myMenu() //Creates a menu with a class current to the current page item
{
		$menuItems = array (
			"Strona Głowna" => "index.php",
			"O nas" => "o-nas.php",
			"Oferta" => "oferta.php",
			"Polecane kierunki" => "polecane-kierunki.php",
			"kontakt" => "kontakt.php",
		);
		foreach($menuItems as $name => $url) {
			$class = 'default';
			$index = 'index.php';
				if ((curPageName() == $url) && (curPageName() != $index)) {
					$class='current';
					echo "<li><a href='$url' class='$class'>$name</a></li>";
				}
				elseif (curPageName() == $index) {
					$class='current home';
					echo "<li><a href='$url' class='$class'>$name</a></li>";
				}
				
			};
};
But now, ALL menu items have the class "home current" - why?

Thank you!
alexandruv is offline   Reply With Quote