06-14-2008, 11:47 PM
|
#1 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: In my basement
Posts: 368
Thanks: 44
|
Breadcrumb Navigation?
Yeah... It just doesn't feel like this is the right way.
I serialize an array of the home/category/.../page breadcrumbness, and then I do this... It just doesn't seem like the right method. Any help?
PHP Code:
// Develop the breadcrumb Navigation
public function getLocation($location) {
//Unserialize the location array.
$location = unserialize($location);
$return = ' ';
foreach ($location as $url => $title) {
if ($url != 'current') {
if ($url == ROOT) {
$title = '<img src="'.ROOT.'resources/images/house_go.gif" alt="Go to the home page" />';
}
$return .= '<a href="' . $url . '">' . $title . '</a> » ';
}
else {
// Caps insensitive
if (strtolower($title) == 'home'){
return '<img src="'.ROOT.'resources/images/house.gif" alt="You are at the home page" />';
}
$return .= $title;
}
}
return $return;
}
|
|
|