1. You could use a switch statement and check for each case of the sub sections.
PHP Code:
if = home {
// set main menu with class
}
if = work {
// set main menu with class
checksubmenu($page);
}
if = about {
// set main menu with class
}
function checksubmenu($page) {
switch($page) {
case: 'print'
// print link
break;
case: 'web'
// print link
break;
case: 'branding'
// print link
break;
case: default
// print link for all
}
}
2. The subsections could be passed via a variable, and you just check for it to see which additional link gets that class as well.
PHP Code:
if $_GET['section'] = "print"
// print link
else if $_GET['section'] = "web"
// print link
else if $_GET['section'] = "branding"
// print link
else if $_GET['section'] = "print"
// print link
else
// print link
Coding is crude but you get the idea.
Bookmarks