Question: php include + id current
Moderator: General Moderators
Question: php include + id current
hi Guys,
i am using a php include for a menu across about 20 pages.
is there a way i can still use the php include and be able to show some how what page they are on?
in the past i have used css and id=current but that was with the menu hard coded on everypage.
thanks guys
i am using a php include for a menu across about 20 pages.
is there a way i can still use the php include and be able to show some how what page they are on?
in the past i have used css and id=current but that was with the menu hard coded on everypage.
thanks guys
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
if you're doing index.php?page=currentpage. simply go
something like that? 
Code: Select all
$page=$_GET['page'];
switch ($page)
{
case"main":
echo "Home page";
break;
}-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
at the moment my navigation.php is just all <li> list elements. i want to add id=current (css) to the page they are on so if you look at the navigation being displayed it will show that link in the navagtion in a different colour.
but to do that i would have to hard code the navagation into every page and on each different page add id=current to a <li>
was wondering if there is a way i can keep my php include navagation.php and still have this effect.
sorry if i am not making sense. does this help?
but to do that i would have to hard code the navagation into every page and on each different page add id=current to a <li>
was wondering if there is a way i can keep my php include navagation.php and still have this effect.
sorry if i am not making sense. does this help?
-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm
i think i have got it now.
something like this in my navagation.php?
Code: Select all
if ($pageis=="home")
{
print('<li id=\"current\">Home</li>');
}
else
{
print('<li>home</li>');
}-
Charles256
- DevNet Resident
- Posts: 1375
- Joined: Fri Sep 16, 2005 9:06 pm