From c096d42568d95d5d2994586b3b84e7e530000fce Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 11 Dec 2003 21:21:16 +0000 Subject: - Patch 187: made taxonomy module take advantage of breadcrumb navigation. Modified patch by Moshe. --- modules/taxonomy/taxonomy.module | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/taxonomy/taxonomy.module') 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; } } -- cgit v1.2.3