hi
i have two menus that i use as include in index.php file:
topmenu and leftmenu
I'm using the same code in oder to show the active header switch (THIS_PAGE):
Code for the "Top menu include":
<?php
define('THIS_PAGE', 'pagename');
$menuitem1 = '<a href="index.php">Home</a>';
$menuitem2 = '<a href="about.php">About</a>';
$menuitem3 = '<a href="news.php">News</a>';
$menuitem4 = '<a href="contact.php">Contact</a>';
switch (THIS_PAGE) {
case 'HOME':
$menuitem1 = '<a style="font-weight:bold" href="#nogo">Home</a>';
break;
case 'About':
$menuitem2 = '<a style="font-weight:bold" href="#nogo">About</a>';
break;
case 'News':
$menuitem3 = '<a style="font-weight:bold" href="#nogo">News</a>';
break;
case 'Contact':
$menuitem4 = '<a style="font-weight:bold" href="#nogo">Contact</a>';
break;
default:
break;
}
echo ' <ul id="list-nav">
<li>'.$menuitem1.'</li>
<li>'.$menuitem2.'</li>
<li>'.$menuitem3.'</li>
<li>'.$menuitem4.'</li>
</ul>';
?>
code for the "left menu include":
<?php
define('THIS_PAGE', 'pagename2');
$menuitem1 = '<a href="book.php">Book Design</a>';
$menuitem2 = '<a href="identityDesign.php">Identity Design</a>';
$menuitem3 = '<a href="logos.php">Logos</a>';
$menuitem4 = '<a href="packaging.php">Packaging</a>';
$menuitem5 = '<a href="index.php">Selected Projects</a>';
switch (THIS_PAGE) {
case 'BookDesign':
$menuitem1 = '<a style="font-color:#eb0089" href="#nogo">Book Design</a>';
break;
case 'IdentityDesign':
$menuitem2 = '<a style="font-color:#eb0089" href="#nogo">Identity Design</a>';
break;
case 'Logos':
$menuitem3 = '<a style="font-color:#eb0089" href="#nogo">Logos</a>';
break;
case 'Packaging':
$menuitem4 = '<a style="font-color:#eb0089" href="#nogo">Packaging</a>';
break;
case 'Selected':
$menuitem5 = '<a style="font-color:#eb0089" href="#nogo">Selected Projects</a>';
break;
default:
break;
}
echo ' <ul>
<li>'.$menuitem1.'</li>
<li>'.$menuitem2.'</li>
<li>'.$menuitem3.'</li>
<li>'.$menuitem4.'</li>
<li >'.$menuitem5.'</li>
</ul>';
?>
the problem is that the index.php doesn't like that i use the same "define" twice
<?php
define('THIS_PAGE', 'Selected');
include('includes/left.php');
?>
</section>
<section id="content">
<!--top-->
<?php
define('THIS_PAGE', 'HOME');
include('includes/menu.php');
?>
i tried to change the name of one of them but ist still doesn't work, what should i do in order to make them work.
Thanks