Skip to content
Snippets Groups Projects
Commit 4c44fad0 authored by Tim Steiner's avatar Tim Steiner
Browse files

Update the breadcrumbs to actually be correct and somewhat useful.

parent 1011f0e9
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,32 @@ $template->head .= "\n" . $this->headLink()->__toString()
. "\n" . $this->headStyle()->__toString();
$template->loadSharedCodeFiles();
$defaultBreadcrumbs = array(
'<a href="http://www.unl.edu/">UNL</a>',
'<a href="http://www.unl.edu/ous">Undergraduate Studies</a>'
);
if (!$this->layout()->breadcrumbs && $this->layout()->title) {
$defaultBreadcrumbs[] = '<a href="' . Zend_Controller_Front::getInstance()->getBaseUrl() . '">' . $this->layout()->title . '</a>';
}
if (!$this->layout()->breadcrumbs && $this->layout()->tagline) {
$defaultBreadcrumbs[] = $this->layout()->tagline;
}
$this->layout()->breadcrumbs = array_merge($defaultBreadcrumbs, (array) $this->layout()->breadcrumbs);
$breadcrumbCount = 0;
$template->breadcrumbs = '<ul>' . "\n";
foreach ($this->layout()->breadcrumbs as $breadcrumb) {
$breadcrumbCount++;
if ($breadcrumbCount == 1) {
$template->breadcrumbs .= '<li class="first">' . $breadcrumb . '</li>' . "\n";
} else {
$template->breadcrumbs .= '<li>' . $breadcrumb . '</li>' . "\n";
}
}
$template->breadcrumbs .= '</ul>' . "\n";
echo "<?xml version='1.0' encoding='UTF-8'?>\n";
$html = $template->toHtml();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment