Forum Moderators: open
How can you implement this when the navigation bar is included with a server-side include, so it's the same for the entire site?
The simplest method I can think of would be to have different includes for the index page of each category in the primary navigation. You'd only need a handful of extra ssi files.
Is there an easier way to do this with CSS and HTML?
if php you can do:
before the opening <html> tag of each pages:
<?php $mypage="home"?> if on homepage
or
<?php $mypage="about"?> if on about page
....
in your ssi:
<?php if ($mypage =="home"){?>
home
<? } else {?>
<a href="index.php" > home </a>
<? } if ($mypage=="about"){?>
about
<? } else {?>
<a href="about.php" > about</a>
<? }?>
Leo
one include with some news that you want to display on homepage, the same include with your products or services to be displayed on the product page and services page and one include with the alternate email that you could show on the about page as well as the contact page.
the possibilites are endless ;-)
leo
I was thinking more about how to use PHP to customize pages. I've got includes for repeated sections of pages.
I've used PHP to run my contact pages, special online forms (like job applications), a forum, announcements (which the site owner can update easily), and photo albums.
After reading your first post, it struck me that there might be even simpler uses that I'm missing, things like the way you suggested turning off the navigation bar's link for the current page.
Are there other places that you typically use PHP to serve up custom pages?
what I meant in my previous post was that I have one include for the whole site and in this include I have all the possible info to be displayed on all the pages of the site.
let's say:
include left:
<? if (isset($page)) {?>
show navigation
<? } if ($page =="news" ¦¦ page =="home") {?>
show news
<? } if ($page!="contact") {?>
show contact details
...
hope this is what you're after.
leo