hello all.
this code creates dynamic breadcrumbs, ie: home > site nav > community
I am having a bit of a time trying to make it so it doesn't hyperlink the
current page thats being viewed, any help is appreciated.
<?
$LocationMappings = array(
"view.php" => "site map",
"company" => "about",
"articles" => "news"
);
function LocatorLine()
{
global $SCRIPT_NAME, $LocationMappings;
$file=1; // 1 Doesn't show the file name, 0 Does
$locationArray = explode("/",$SCRIPT_NAME);
$locationHref = "";
echo '<span class="smalltext">:: <a href="/">main page</a></span>';
for($i=1; $i<count($locationArray)-$file; $i++)
{
if ( !empty($LocationMappings[$locationArray[$i]]) ) {
$locationText = $LocationMappings[$locationArray[$i]];
}
else {
$locationText = ucwords($locationArray[$i]); //Uppercase
letters
}
$locationHref .= "/" . $locationArray[$i];
echo " <b>»</b> <a
href=\"$locationHref\">$locationText</a>";
}
echo "\n";
}
LocatorLine()
?>
cheers,
- Sebastian