
Originally Posted by
jeffposaka
It is a dynamic site using skins so I cannot identify each page as active in the navigation, with a currentpage tag (as far as I know).....
I believe there is a difference between active link and current page.
The active link does indeed work and would normally be used with anchors within the same page. Once you click on the link and CHANGE page then it is no longer the active link (I think that makes some sort of sense).
I do have a solution using a php function.
see http://www.godfreyhart.com/test/page1.php
It does not work on my test server but it does online??
Code:
<?
function nav_buttons($file,$title)
{
if (substr($_SERVER['PHP_SELF'], 1)=="test/".$file)
{
$button_string="<span class='currentpage'>".$title."</span>";
}
else
{
$button_string="<a href=\"".$file."\">".$title."</a>";
}
return $button_string;
}
?>
<html>
<head>
<style type="text/css">
<!--
body {background-color: #FF9999;}
ul{list-style-type: none;}
li{display: block;}
a{color: #fff;}
a:hover{color: #000;}
.currentpage{background-color: #fff; color: #FF9999;}
-->
</style>
</head>
<body>
<div>
<ul>
[*]<? $button_string=nav_buttons("page1.php","text1"); echo $button_string;?>
[*]<? $button_string=nav_buttons("page2.php","text2"); echo $button_string;?>
[*]<? $button_string=nav_buttons("page3.php","text3"); echo $button_string;?>
[*]<? $button_string=nav_buttons("page4.php","text4"); echo $button_string;?>
[*]<? $button_string=nav_buttons("page5.php","text5"); echo $button_string;?>
[/list]
</div>
</body>
</html>
(Same code for each page)
Hope this helps