July 14, 200818 yr Hi again, I have yet another problem.... My nav shows the currently selected file, i usually set this by <body id="services"> and changing the body id for each page then i change the colour of the nav when selected using css...singe the body tag is in a common file now which i am drawing into each file, and the nav is also in a common file, is there another way i can make the nav show the current page? As i have said in previous posts, I have changed hosts, my old host customised all this stuff so it was very different, so everything is different....a bit of a pain really but at least i am learning the "right way" now. Thanks a lot for all your help, it has been so great!!
July 30, 200818 yr Author anyone have an idea of how i can do this? tell the nav which page i am on when the main parts of each page are being drawn from a single file?
July 30, 200818 yr You can use a php switch statement to insert the id="" part into your navigation somewhere. There is a global variable $_PHP_SELF which will be equal to the URL to the current page.
August 4, 200818 yr Author thanks for the reply, im new to all this so although i kind of get what your on about, would you be able to make it any clearer for a complete beginner?
August 4, 200818 yr There is a global variable $_PHP_SELF which will be equal to the URL to the current page. Isn't that manipulatablebleble though? http://www.calmbanana.co.uk/writing/custom-keywords/ That tutorial might be worth adapting to your needs... Instead of having <meta <?php ?>> etc, you would have... <body id="<?php echo $bodyid ?>">
August 4, 200818 yr Author thank you so much I figured it out!! yay its working When I am drawing the header in on each page the includes says: <? php $bodyid="pagenamehere"; include("header.php"); ?> and then when I am setting the body id in the common header file it says: <body id="<?php echo$bodyid; ?>"> And it works a treat!!! so exciting when something works!! Thanks heaps!!
Create an account or sign in to comment