diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-12-11 21:21:16 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-12-11 21:21:16 +0000 |
commit | c096d42568d95d5d2994586b3b84e7e530000fce (patch) | |
tree | c79a7241033940f1456a2830fb46eccb3bfbca70 /modules | |
parent | b1ef96931af52cd6234162f4d2dc6e2736c00d8e (diff) | |
download | brdo-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')
-rw-r--r-- | modules/taxonomy.module | 13 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 13 |
2 files changed, 24 insertions, 2 deletions
diff --git a/modules/taxonomy.module b/modules/taxonomy.module index dd31cc688..b63c2d7c7 100644 --- a/modules/taxonomy.module +++ b/modules/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; } } 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; } } |