summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-12-11 21:21:16 +0000
committerDries Buytaert <dries@buytaert.net>2003-12-11 21:21:16 +0000
commitc096d42568d95d5d2994586b3b84e7e530000fce (patch)
treec79a7241033940f1456a2830fb46eccb3bfbca70 /modules/taxonomy/taxonomy.module
parentb1ef96931af52cd6234162f4d2dc6e2736c00d8e (diff)
downloadbrdo-c096d42568d95d5d2994586b3b84e7e530000fce.tar.gz
brdo-c096d42568d95d5d2994586b3b84e7e530000fce.tar.bz2
- Patch 187: made taxonomy module take advantage of breadcrumb navigation.
Modified patch by Moshe.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index dd31cc688..b63c2d7c7 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -721,13 +721,24 @@ function taxonomy_page() {
taxonomy_feed($taxonomy);
break;
default:
+ // Build title:
$sql = 'SELECT name FROM term_data WHERE tid IN (%s)';
$result = db_query($sql, $taxonomy->str_tids);
while ($term = db_fetch_object($result)) {
$names[] = $term->name;
}
+
+ // Build breadcrumb based on first hierarchy of first term:
+ $current->tid = $taxonomy->tids[0];
+ while ($parents = taxonomy_get_parents($current->tid)) {
+ $current = array_shift($parents);
+ $breadcrumbs[] = l($current->name, "taxonomy/view/or/$current->tid");
+ }
+ $breadcrumbs[] = l(t('Home'), '');
+ $breadcrumbs = array_reverse($breadcrumbs);
+
$output = taxonomy_render_nodes(taxonomy_select_nodes($taxonomy));
- print theme("page", $output, implode(', ', $names));
+ print theme("page", $output, implode(', ', $names), $breadcrumbs);
break;
}
}