Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

current page display in nav

Featured Replies

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!!

  • 3 weeks later...
  • 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?

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.

  • 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?

There is a global variable $_PHP_SELF which will be equal to the URL to the current page.

 

Isn't that manipulatablebleble though? :huh:

 

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 ?>">

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.